@@ -237,3 +237,96 @@ jobs:
237237 path : /tmp/digests/*
238238 if-no-files-found : error
239239 retention-days : 1
240+
241+ merge-buildbox :
242+ runs-on : ubuntu-latest
243+ needs :
244+ - build-buildbox
245+ steps :
246+ - uses : actions/checkout@v4
247+ - name : Prepare env
248+ run : |
249+ echo "BUILDBOX_IMAGE_VERSION=$(./internal/lib/docker_image_info.sh buildbox_version)" >> $GITHUB_ENV
250+ echo "BUILDBOX_IMAGE_NAME=$(./internal/lib/docker_image_info.sh buildbox_name)" >> $GITHUB_ENV
251+
252+ - name : Login to GHCR
253+ uses : docker/login-action@v3
254+ with :
255+ registry : ghcr.io
256+ username : ${{ github.repository_owner }}
257+ password : ${{ secrets.GITHUB_TOKEN }}
258+
259+ - name : Set up Docker Buildx
260+ uses : docker/setup-buildx-action@v3
261+
262+ - name : Download digests
263+ uses : actions/download-artifact@v4
264+ with :
265+ path : /tmp/digests
266+ pattern : digests-buildbox-*
267+ merge-multiple : true
268+
269+ - name : Docker meta
270+ id : meta
271+ uses : docker/metadata-action@v5
272+ with :
273+ images : |
274+ ghcr.io/${{ env.BUILDBOX_IMAGE_NAME }}
275+ tags : |
276+ type=raw,value=${{ env.BUILDBOX_IMAGE_VERSION }}
277+ type=raw,value=latest
278+ type=edge,enable=true,priority=700,prefix=,suffix=,branch=$repo.default_branch
279+
280+ - name : Create manifest list and push
281+ working-directory : /tmp/digests
282+ run : docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") $(printf 'ghcr.io/${{ env.BUILDBOX_IMAGE_NAME }}@sha256:%s ' *)
283+
284+ - name : Inspect image
285+ run : docker buildx imagetools inspect ghcr.io/${{ env.BUILDBOX_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
286+
287+
288+ merge-ubuntus :
289+ runs-on : ubuntu-latest
290+ needs :
291+ - build-ubuntus
292+ steps :
293+ - uses : actions/checkout@v4
294+ - name : Prepare env
295+ run : |
296+ echo "TESTBOX_IMAGE_VERSION=$(./internal/lib/docker_image_info.sh testbox_version)" >> $GITHUB_ENV
297+ echo "TESTBOX_IMAGE_NAME=$(./internal/lib/docker_image_info.sh testbox_base_name)_ubuntu_${distro//\./_}" >> $GITHUB_ENV
298+
299+ - name : Login to GHCR
300+ uses : docker/login-action@v3
301+ with :
302+ registry : ghcr.io
303+ username : ${{ github.repository_owner }}
304+ password : ${{ secrets.GITHUB_TOKEN }}
305+
306+ - name : Set up Docker Buildx
307+ uses : docker/setup-buildx-action@v3
308+
309+ - name : Download digests
310+ uses : actions/download-artifact@v4
311+ with :
312+ path : /tmp/digests
313+ pattern : digests-ubuntu-*
314+ merge-multiple : true
315+
316+ - name : Docker meta
317+ id : meta
318+ uses : docker/metadata-action@v5
319+ with :
320+ images : |
321+ ghcr.io/${{ env.TESTBOX_IMAGE_NAME }}
322+ tags : |
323+ type=raw,value=${{ env.TESTBOX_IMAGE_VERSION }}
324+ type=raw,value=latest
325+ type=edge,enable=true,priority=700,prefix=,suffix=,branch=$repo.default_branch
326+
327+ - name : Create manifest list and push
328+ working-directory : /tmp/digests
329+ run : docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") $(printf 'ghcr.io/${{ env.TESTBOX_IMAGE_NAME }}@sha256:%s ' *)
330+
331+ - name : Inspect image
332+ run : docker buildx imagetools inspect ghcr.io/${{ env.TESTBOX_IMAGE_NAME }}:${{ steps.meta.outputs.version }}
0 commit comments