@@ -129,6 +129,7 @@ jobs:
129129
130130 - uses : docker/build-push-action@v6
131131 name : Build & Push Container Images
132+ id : build
132133 with :
133134 context : .
134135 file : Dockerfile
@@ -140,14 +141,65 @@ jobs:
140141141142 platforms : linux/${{matrix.arch}}
142143 push : true
143- provenance : false
144- sbom : false
145144 cache-from : type=gha
146145 cache-to : type=gha,mode=max
147146 tags : |-
148147 ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
149148 ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
150149
150+ - name : Export digest
151+ run : |
152+ mkdir -p /tmp/digests
153+ digest="${{ steps.build.outputs.digest }}"
154+ touch "/tmp/digests/${digest#sha256:}"
155+
156+ - name : Upload digest
157+ uses : actions/upload-artifact@v4
158+ with :
159+ name : digests-linux-${{matrix.arch}}
160+ path : /tmp/digests/*
161+ if-no-files-found : error
162+ retention-days : 1
163+
164+ merge :
165+ runs-on : ubuntu-latest
166+ needs :
167+ - images
168+ steps :
169+ - name : Download digests
170+ uses : actions/download-artifact@v4
171+ with :
172+ path : /tmp/digests
173+ pattern : digests-*
174+ merge-multiple : true
175+
176+ - name : Login to GitHub Container Registry
177+ uses : docker/login-action@v3
178+ with :
179+ registry : ghcr.io
180+ username : ${{ github.actor }}
181+ password : ${{ secrets.GITHUB_TOKEN }}
182+
183+ - name : Set up Docker Buildx
184+ uses : docker/setup-buildx-action@v3
185+
186+ - name : Create manifest list and push
187+ working-directory : /tmp/digests
188+ run : |
189+ docker buildx imagetools create \
190+ -t "${{ env.REGISTRY_IMAGE }}:latest" \
191+ -t "${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}" \
192+ $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
193+ env :
194+ REGISTRY_IMAGE : ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
195+
196+ - name : Inspect image
197+ run : |
198+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:latest
199+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}"
200+ env :
201+ REGISTRY_IMAGE : ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
202+
151203 helm-chart :
152204 if : false
153205 runs-on : ubuntu-latest
0 commit comments