4545 publish-cloudflare-deployer-image :
4646 needs : release
4747 if : ${{ needs.release.outputs.cloudflare_resolver_release_created == 'true' || inputs.force_cloudflare_deploy == true }}
48+ runs-on : ${{ matrix.runner }}
49+ strategy :
50+ fail-fast : true
51+ matrix :
52+ include :
53+ - platform : linux/amd64
54+ runner : ubuntu-latest
55+ - platform : linux/arm64
56+ runner : ubuntu-24.04-arm
57+ permissions :
58+ contents : read
59+ packages : write
60+ steps :
61+ - name : Checkout
62+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
63+
64+ - name : Set up Docker Buildx
65+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
66+
67+ - name : Log in to GHCR
68+ uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
69+ with :
70+ registry : ghcr.io
71+ username : ${{ github.actor }}
72+ password : ${{ secrets.GITHUB_TOKEN }}
73+
74+ - name : Build and push by digest
75+ id : build
76+ uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
77+ with :
78+ context : .
79+ target : confidence-cloudflare-resolver.deployer
80+ build-args : |
81+ COMMIT_SHA=${{ github.sha }}
82+ platforms : ${{ matrix.platform }}
83+ cache-from : type=registry,ref=ghcr.io/${{ github.repository }}/cache:main
84+ outputs : type=image,name=ghcr.io/${{ github.repository_owner }}/confidence-cloudflare-deployer,push-by-digest=true,name-canonical=true,push=true
85+
86+ - name : Export digest
87+ run : |
88+ mkdir -p $RUNNER_TEMP/digests
89+ digest="${{ steps.build.outputs.digest }}"
90+ touch "$RUNNER_TEMP/digests/${digest#sha256:}"
91+
92+ - name : Upload digest
93+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
94+ with :
95+ name : deployer-digest-${{ matrix.runner }}
96+ path : ${{ runner.temp }}/digests/*
97+ if-no-files-found : error
98+ retention-days : 1
99+
100+ publish-cloudflare-deployer-manifest :
101+ needs : [release, publish-cloudflare-deployer-image]
102+ if : ${{ needs.release.outputs.cloudflare_resolver_release_created == 'true' || inputs.force_cloudflare_deploy == true }}
48103 runs-on : ubuntu-latest
49104 permissions :
50105 contents : read
@@ -60,11 +115,12 @@ jobs:
60115 echo "CCR_VERSION=$VERSION" >> $GITHUB_ENV
61116 echo "CCR_TAG_NAME=confidence-cloudflare-resolver-v$VERSION" >> $GITHUB_ENV
62117
63- - name : Set up QEMU
64- uses : docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
65-
66- - name : Set up Docker Buildx
67- uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
118+ - name : Download digests
119+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
120+ with :
121+ path : ${{ runner.temp }}/digests
122+ pattern : deployer-digest-*
123+ merge-multiple : true
68124
69125 - name : Log in to GHCR
70126 uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
@@ -82,18 +138,12 @@ jobs:
82138 type=raw,value=${{ env.CCR_TAG_NAME }}
83139 type=raw,value=latest
84140
85- - name : Build and push deployer image
86- uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
87- with :
88- context : .
89- target : confidence-cloudflare-resolver.deployer
90- push : true
91- build-args : |
92- COMMIT_SHA=${{ github.sha }}
93- platforms : linux/amd64,linux/arm64
94- cache-from : type=registry,ref=ghcr.io/${{ github.repository }}/cache:main
95- tags : ${{ steps.meta.outputs.tags }}
96- labels : ${{ steps.meta.outputs.labels }}
141+ - name : Create manifest list and push
142+ working-directory : ${{ runner.temp }}/digests
143+ run : |
144+ docker buildx imagetools create \
145+ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
146+ $(printf 'ghcr.io/${{ github.repository_owner }}/confidence-cloudflare-deployer@sha256:%s ' *)
97147
98148 publish-java-provider-release :
99149 needs : release
0 commit comments