74
74
submodules : false
75
75
fetch-depth : 0
76
76
77
+ - name : Login to Docker Hub
78
+ uses : docker/login-action@v3
79
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
80
+ with :
81
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
82
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
83
+
84
+ - name : Login to GitHub Container Registry
85
+ uses : docker/login-action@v3
86
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
87
+ with :
88
+ registry : ghcr.io
89
+ username : ${{ github.actor }}
90
+ password : ${{ secrets.GITHUB_TOKEN }}
91
+
77
92
- name : Set up Docker Buildx
78
93
uses : docker/setup-buildx-action@v3
79
94
with :
88
103
labels : ${{ needs.setup.outputs.meta_labels }}
89
104
platforms : ${{ env.PLATFORM_NAME }}
90
105
load : false
91
- push : false
106
+ push : true
92
107
cache-from : type=gha,version=1
93
108
cache-to : type=gha,version=1,mode=max
94
109
@@ -114,26 +129,6 @@ jobs:
114
129
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
115
130
steps :
116
131
- uses : runs-on/action@v1
117
- - uses : actions/checkout@v4
118
- with :
119
- fetch-tags : true
120
- submodules : false
121
- fetch-depth : 0
122
-
123
- - name : Set PX4 Tag Version
124
- id : px4_version
125
- run : |
126
- echo "px4_version=$(git describe --tags --match 'v[0-9]*')" >> $GITHUB_OUTPUT
127
-
128
- - name : Extract metadata (tags, labels) for Docker
129
- id : meta
130
- uses : docker/metadata-action@v5
131
- with :
132
- images : |
133
- ghcr.io/PX4/px4-dev
134
- px4io/px4-dev
135
- tags : |
136
- type=raw,enable=true,value=${{ needs.setup.outputs.px4_version }},priority=1000
137
132
138
133
- name : Login to Docker Hub
139
134
uses : docker/login-action@v3
@@ -150,18 +145,6 @@ jobs:
150
145
username : ${{ github.actor }}
151
146
password : ${{ secrets.GITHUB_TOKEN }}
152
147
153
- - name : Cache Apt Registry
154
- uses : runs-on/cache@v4
155
- id : cache
156
- with :
157
- path : |
158
- var-cache-apt
159
- var-lib-apt
160
- key : cache-${{ hashFiles('Tools/setup/Dockerfile') }}
161
-
162
- - name : Set up Docker Buildx
163
- uses : docker/setup-buildx-action@v3
164
-
165
148
- name : Push Images to Registry
166
149
uses : docker/build-push-action@v6
167
150
with :
@@ -170,6 +153,6 @@ jobs:
170
153
labels : ${{ needs.setup.outputs.meta_labels }}
171
154
platforms : linux/amd64,linux/arm64
172
155
load : false
173
- push : ${{ startsWith(github.ref, 'refs/tags/') }}
156
+ push : true
174
157
cache-from : type=gha,version=1
175
158
cache-to : type=gha,version=1,mode=max
0 commit comments