@@ -19,11 +19,20 @@ concurrency:
19
19
group : ${{ github.ref }}
20
20
cancel-in-progress : true
21
21
22
+ env :
23
+ DOCKERHUB_BASE : docker.io/zephyrprojectrtos
24
+ GHCR_BASE : ghcr.io/zephyrproject-rtos
25
+ BASE_IMAGE_NAME : ci-base-testing
26
+ CI_IMAGE_NAME : ci-testing
27
+ DEVELOPER_IMAGE_NAME : zephyr-build-testing
28
+
22
29
jobs :
23
30
build :
24
31
name : Build (${{ matrix.variant.platform }})
25
32
runs-on :
26
33
group : ${{ matrix.variant.builder }}
34
+ container :
35
+ image : ghcr.io/zephyrproject-rtos/image-build:v1.0.0
27
36
28
37
strategy :
29
38
fail-fast : true
@@ -36,215 +45,169 @@ jobs:
36
45
arch : arm64
37
46
builder : zephyr-runner-v2-linux-arm64-4xlarge
38
47
39
- services :
40
- registry :
41
- image : registry:2
42
- ports :
43
- - 5000:5000
44
-
45
48
steps :
46
49
- name : Checkout
47
50
uses : actions/checkout@v3
48
51
49
- - name : Generate local metadata for base image
50
- id : meta_ci_base
51
- uses : docker/metadata-action@v4
52
- with :
53
- images : |
54
- localhost:5000/zephyrproject-rtos/ci-base-testing
55
-
56
- - name : Generate local metadata for CI image
57
- id : meta_ci
58
- uses : docker/metadata-action@v4
52
+ - name : Login to DockerHub
53
+ if : ${{ github.event_name != 'pull_request' }}
54
+ uses : redhat-actions/podman-login@v1
59
55
with :
60
- images : |
61
- localhost:5000/zephyrproject-rtos/ci-testing
56
+ registry : docker.io
57
+ username : ${{ vars.DOCKERHUB_USERNAME }}
58
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
62
59
63
- - name : Generate local metadata for Developer image
64
- id : meta_developer
65
- uses : docker/metadata-action@v4
60
+ - name : Login to GitHub Container Registry
61
+ if : ${{ github.event_name != 'pull_request' }}
62
+ uses : redhat-actions/podman-login@v1
66
63
with :
67
- images : |
68
- localhost:5000/zephyrproject-rtos/zephyr-build-testing
64
+ registry : ghcr.io
65
+ username : ${{ github.repository_owner }}
66
+ password : ${{ secrets.GITHUB_TOKEN }}
69
67
70
- - name : Generate push metadata for base image
68
+ - name : Generate metadata for base image
71
69
if : ${{ github.event_name != 'pull_request' }}
72
- id : meta_ci_base_push
70
+ id : meta_ci_base
73
71
uses : docker/metadata-action@v4
74
72
with :
75
73
images : |
76
- docker.io/zephyrprojectrtos/ci-base-testing
77
- ghcr.io/zephyrproject-rtos/ci-base-testing
74
+ ${{ env.DOCKERHUB_BASE }}/${{ env.BASE_IMAGE_NAME }}
75
+ ${{ env.GHCR_BASE }}/${{ env.BASE_IMAGE_NAME }}
78
76
flavor : |
79
77
latest=false
80
78
suffix=-${{ matrix.variant.arch }}
81
79
tags : |
82
80
type=ref,event=branch
83
81
type=ref,event=tag
84
82
85
- - name : Generate push metadata for CI image
83
+ - name : Generate metadata for CI image
86
84
if : ${{ github.event_name != 'pull_request' }}
87
- id : meta_ci_push
85
+ id : meta_ci
88
86
uses : docker/metadata-action@v4
89
87
with :
90
88
images : |
91
- docker.io/zephyrprojectrtos/ci-testing
92
- ghcr.io/zephyrproject-rtos/ci-testing
89
+ ${{ env.DOCKERHUB_BASE }}/${{ env.CI_IMAGE_NAME }}
90
+ ${{ env.GHCR_BASE }}/${{ env.CI_IMAGE_NAME }}
93
91
flavor : |
94
92
latest=false
95
93
suffix=-${{ matrix.variant.arch }}
96
94
tags : |
97
95
type=ref,event=branch
98
96
type=ref,event=tag
99
97
100
- - name : Generate push metadata for Developer image
98
+ - name : Generate metadata for Developer image
101
99
if : ${{ github.event_name != 'pull_request' }}
102
- id : meta_developer_push
100
+ id : meta_developer
103
101
uses : docker/metadata-action@v4
104
102
with :
105
103
images : |
106
- docker.io/zephyrprojectrtos/zephyr-build-testing
107
- ghcr.io/zephyrproject-rtos/zephyr-build-testing
104
+ ${{ env.DOCKERHUB_BASE }}/${{ env.DEVELOPER_IMAGE_NAME }}
105
+ ${{ env.GHCR_BASE }}/${{ env.DEVELOPER_IMAGE_NAME }}
108
106
flavor : |
109
107
latest=false
110
108
suffix=-${{ matrix.variant.arch }}
111
109
tags : |
112
110
type=ref,event=branch
113
111
type=ref,event=tag
114
112
115
- - name : Set up Docker Buildx
116
- uses : docker/setup-buildx-action@v2
117
- with :
118
- driver-opts : network=host
119
-
120
- - name : Build base docker image
121
- uses : docker/build-push-action@v3
113
+ - name : Build base image
114
+ uses : redhat-actions/buildah-build@v2
122
115
with :
123
116
context : .
124
- file : Dockerfile.base
125
- platforms : ${{ matrix.variant.platform }}
126
- push : true
117
+ containerfiles : Dockerfile.base
127
118
tags : ${{ steps.meta_ci_base.outputs.tags }}
128
119
labels : ${{ steps.meta_ci_base.outputs.labels }}
129
120
130
- - name : Build CI docker image
131
- uses : docker/build-push-action@v3
132
- with :
133
- context : .
134
- file : Dockerfile.ci
135
- platforms : ${{ matrix.variant.platform }}
136
- push : true
137
- tags : ${{ steps.meta_ci.outputs.tags }}
138
- labels : ${{ steps.meta_ci.outputs.labels }}
139
- build-args : |
140
- BASE_IMAGE=localhost:5000/zephyrproject-rtos/ci-base-testing:${{ steps.meta_ci_base.outputs.version }}
141
-
142
- - name : Build Developer docker image
143
- uses : docker/build-push-action@v3
121
+ # - name: Build CI image
122
+ # uses: docker/build-push-action@v3
123
+ # with:
124
+ # context: .
125
+ # file: Dockerfile.ci
126
+ # platforms: ${{ matrix.variant.platform }}
127
+ # push: true
128
+ # tags: ${{ steps.meta_ci.outputs.tags }}
129
+ # labels: ${{ steps.meta_ci.outputs.labels }}
130
+ # build-args: |
131
+ # BASE_IMAGE=localhost:5000/zephyrproject-rtos/ci-base-testing:${{ steps.meta_ci_base.outputs.version }}
132
+
133
+ # - name: Build Developer image
134
+ # uses: docker/build-push-action@v3
135
+ # with:
136
+ # context: .
137
+ # file: Dockerfile.devel
138
+ # platforms: ${{ matrix.variant.platform }}
139
+ # push: true
140
+ # tags: ${{ steps.meta_developer.outputs.tags }}
141
+ # labels: ${{ steps.meta_developer.outputs.labels }}
142
+ # build-args: |
143
+ # BASE_IMAGE=localhost:5000/zephyrproject-rtos/ci-testing:${{ steps.meta_ci.outputs.version }}
144
+
145
+ - name : Push base image
146
+ uses : redhat-actions/push-to-registry@v2
144
147
with :
145
- context : .
146
- file : Dockerfile.devel
147
- platforms : ${{ matrix.variant.platform }}
148
- push : true
149
- tags : ${{ steps.meta_developer.outputs.tags }}
150
- labels : ${{ steps.meta_developer.outputs.labels }}
151
- build-args : |
152
- BASE_IMAGE=localhost:5000/zephyrproject-rtos/ci-testing:${{ steps.meta_ci.outputs.version }}
153
-
154
- - name : Login to DockerHub
155
- if : ${{ github.event_name != 'pull_request' }}
156
- uses : docker/login-action@v2
157
- with :
158
- registry : docker.io
159
- username : ${{ secrets.DOCKERHUB_USERNAME }}
160
- password : ${{ secrets.DOCKERHUB_TOKEN }}
161
-
162
- - name : Login to GitHub Container Registry
163
- if : ${{ github.event_name != 'pull_request' }}
164
- uses : docker/login-action@v2
165
- with :
166
- registry : ghcr.io
167
- username : ${{ github.repository_owner }}
168
- password : ${{ secrets.GITHUB_TOKEN }}
169
-
170
- - name : Push base docker image
171
- if : ${{ github.event_name != 'pull_request' }}
172
- uses :
stephanosio/[email protected]
173
- with :
174
- src : localhost:5000/zephyrproject-rtos/ci-base-testing:${{ steps.meta_ci_base.outputs.version }}
175
- dst : ${{ steps.meta_ci_base_push.outputs.tags }}
176
-
177
- - name : Push CI docker image
178
- if : ${{ github.event_name != 'pull_request' }}
179
- uses :
stephanosio/[email protected]
180
- with :
181
- src : localhost:5000/zephyrproject-rtos/ci-testing:${{ steps.meta_ci.outputs.version }}
182
- dst : ${{ steps.meta_ci_push.outputs.tags }}
183
-
184
- - name : Push Developer docker image
185
- if : ${{ github.event_name != 'pull_request' }}
186
- uses :
stephanosio/[email protected]
187
- with :
188
- src : localhost:5000/zephyrproject-rtos/zephyr-build-testing:${{ steps.meta_developer.outputs.version }}
189
- dst : ${{ steps.meta_developer_push.outputs.tags }}
148
+ tags : ${{ steps.meta_ci_base.outputs.tags }}
190
149
191
150
merge :
192
151
name : Merge
193
152
runs-on :
194
153
group : zephyr-runner-v2-linux-x64-4xlarge
154
+ container :
155
+ image : ghcr.io/zephyrproject-rtos/image-build:v1.0.0
195
156
needs : build
196
157
if : ${{ github.event_name != 'pull_request' }}
197
158
198
159
steps :
199
160
- name : Login to DockerHub
200
- uses : docker/login-action@v2
161
+ if : ${{ github.event_name != 'pull_request' }}
162
+ uses : redhat-actions/podman-login@v1
201
163
with :
202
164
registry : docker.io
203
- username : ${{ secrets .DOCKERHUB_USERNAME }}
165
+ username : ${{ vars .DOCKERHUB_USERNAME }}
204
166
password : ${{ secrets.DOCKERHUB_TOKEN }}
205
167
206
168
- name : Login to GitHub Container Registry
207
- uses : docker/login-action@v2
169
+ if : ${{ github.event_name != 'pull_request' }}
170
+ uses : redhat-actions/podman-login@v1
208
171
with :
209
172
registry : ghcr.io
210
173
username : ${{ github.repository_owner }}
211
174
password : ${{ secrets.GITHUB_TOKEN }}
212
175
213
- - name : Generate push metadata for base docker image
214
- id : meta_ci_base_push
176
+ - name : Generate metadata for base image
177
+ id : meta_ci_base
215
178
uses : docker/metadata-action@v4
216
179
with :
217
180
images : |
218
- docker.io/zephyrprojectrtos/ci-base-testing
219
- ghcr.io/zephyrproject-rtos/ci-base-testing
181
+ ${{ env.DOCKERHUB_BASE }}/${{ env.BASE_IMAGE_NAME }}
182
+ ${{ env.GHCR_BASE }}/${{ env.BASE_IMAGE_NAME }}
220
183
flavor : |
221
184
latest=false
222
185
tags : |
223
186
type=ref,event=branch
224
187
type=ref,event=tag
225
188
type=raw,value=latest,enable={{is_default_branch}}
226
189
227
- - name : Generate push metadata for CI image
228
- id : meta_ci_push
190
+ - name : Generate metadata for CI image
191
+ id : meta_ci
229
192
uses : docker/metadata-action@v4
230
193
with :
231
194
images : |
232
- docker.io/zephyrprojectrtos/ci-testing
233
- ghcr.io/zephyrproject-rtos/ci-testing
195
+ ${{ env.DOCKERHUB_BASE }}/${{ env.CI_IMAGE_NAME }}
196
+ ${{ env.GHCR_BASE }}/${{ env.CI_IMAGE_NAME }}
234
197
flavor : |
235
198
latest=false
236
199
tags : |
237
200
type=ref,event=branch
238
201
type=ref,event=tag
239
202
type=raw,value=latest,enable={{is_default_branch}}
240
203
241
- - name : Generate push metadata for Developer image
242
- id : meta_developer_push
204
+ - name : Generate metadata for Developer image
205
+ id : meta_developer
243
206
uses : docker/metadata-action@v4
244
207
with :
245
208
images : |
246
- docker.io/zephyrprojectrtos/zephyr-build-testing
247
- ghcr.io/zephyrproject-rtos/zephyr-build-testing
209
+ ${{ env.DOCKERHUB_BASE }}/${{ env.DEVELOPER_IMAGE_NAME }}
210
+ ${{ env.GHCR_BASE }}/${{ env.DEVELOPER_IMAGE_NAME }}
248
211
flavor : |
249
212
latest=false
250
213
tags : |
@@ -255,46 +218,46 @@ jobs:
255
218
- name : Create multi-architecture image
256
219
run : |
257
220
archs=(amd64 arm64)
258
- ci_base_image="ghcr.io/zephyrproject-rtos/ci-base-testing:${{ steps.meta_ci_base_push.outputs.version }}"
259
- ci_image="ghcr.io/zephyrproject-rtos/ci-testing:${{ steps.meta_ci_push.outputs.version }}"
260
- developer_image="ghcr.io/zephyrproject-rtos/zephyr-build-testing:${{ steps.meta_developer_push.outputs.version }}"
221
+
222
+ ci_base_image_name="${{ env.BASE_IMAGE_NAME }}:${{ steps.meta_ci_base.outputs.version }}"
223
+ ci_image_name="${{ env.CI_IMAGE_NAME }}:${{ steps.meta_ci.outputs.version }}"
224
+ developer_image_name="${{ env.DEVELOPER_IMAGE_NAME }}:${{ steps.meta_developer.outputs.version }}"
225
+
226
+ ci_base_image="${{ env.GHCR_BASE }}/${ci_base_image_name}"
227
+ ci_image="${{ env.GHCR_BASE }}/${ci_image_name}"
228
+ developer_image="${{ env.GHCR_BASE }}/${developer_image_name}"
261
229
262
230
# Pull architecture-specific images
263
231
for arch in ${archs[@]}; do
264
- docker pull ${ci_base_image}-${arch}
265
- docker pull ${ci_image}-${arch}
266
- docker pull ${developer_image}-${arch}
232
+ podman pull ${ci_base_image}-${arch}
233
+ # podman pull ${ci_image}-${arch}
234
+ # podman pull ${developer_image}-${arch}
267
235
done
268
236
269
- # Create multi-architecture image
237
+ # Create multi-architecture images
270
238
for arch in ${archs[@]}; do
271
239
ci_base_image_amend_flags+="--amend ${ci_base_image}-${arch} "
272
240
ci_image_amend_flags+="--amend ${ci_image}-${arch} "
273
241
developer_image_amend_flags+="--amend ${developer_image}-${arch} "
274
242
done
275
243
276
- docker manifest create ${ci_base_image} ${ci_base_image_amend_flags}
277
- docker manifest create ${ci_image} ${ci_image_amend_flags}
278
- docker manifest create ${developer_image} ${developer_image_amend_flags}
244
+ podman manifest create ${ci_base_image} ${ci_base_image_amend_flags}
245
+ # podman manifest create ${ci_image} ${ci_image_amend_flags}
246
+ # podman manifest create ${developer_image} ${developer_image_amend_flags}
279
247
280
- docker manifest push ${ci_base_image}
281
- docker manifest push ${ci_image}
282
- docker manifest push ${developer_image}
248
+ # podman manifest push ${ci_base_image}
249
+ # podman manifest push ${ci_image}
250
+ # podman manifest push ${developer_image}
283
251
284
- - name : Push base docker image
285
- uses :
stephanosio/[email protected]
286
- with :
287
- src : ghcr.io/zephyrproject-rtos/ci-base-testing:${{ steps.meta_ci_base_push.outputs.version }}
288
- dst : ${{ steps.meta_ci_base_push.outputs.tags }}
252
+ # Tag DockerHub multi-architecture images
253
+ podman tag ${ci_base_image} ${{ env.DOCKERHUB_BASE }}/${ci_base_image_name}
254
+ # podman tag ${ci_image} ${{ env.DOCKERHUB_BASE }}/${ci_image_name}
255
+ # podman tag ${developer_image} ${{ env.DOCKERHUB_BASE }}/${developer_image_name}
289
256
290
- - name : Push CI docker image
291
- uses : stephanosio/tag- push-action @v2.1.0
257
+ - name : Push base image
258
+ uses : redhat-actions/ push-to-registry @v2
292
259
with :
293
- src : ghcr.io/zephyrproject-rtos/ci-testing:${{ steps.meta_ci_push.outputs.version }}
294
- dst : ${{ steps.meta_ci_push.outputs.tags }}
260
+ tags : ${{ steps.meta_ci_base.outputs.tags }}
295
261
296
- - name : Push Developer docker image
297
- uses :
stephanosio/[email protected]
298
- with :
299
- src : ghcr.io/zephyrproject-rtos/zephyr-build-testing:${{ steps.meta_developer_push.outputs.version }}
300
- dst : ${{ steps.meta_developer_push.outputs.tags }}
262
+ # TODO: Push CI image
263
+ # TODO: Push Developer image
0 commit comments