Skip to content

Commit c93f58d

Browse files
✨ add attestations to image build
1 parent 1dcac08 commit c93f58d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/build-push-images.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ jobs:
7272
build:
7373
needs: [ prepare ]
7474
runs-on: ubuntu-latest
75+
permissions:
76+
id-token: write
77+
contents: read
78+
attestations: write
79+
packages: write
7580
env:
7681
tag: ${{ needs.prepare.outputs.tag }}
7782
strategy:
@@ -162,9 +167,21 @@ jobs:
162167
password: ${{ secrets.registry_password }}
163168
registry: ${{ inputs.registry }}
164169

170+
- name: Generate artifact attestation
171+
uses: actions/attest-build-provenance@v2
172+
with:
173+
subject-name: ${{ inputs.registry }}/${{ steps.build.outputs.image-with-tag }}
174+
subject-digest: ${{ steps.push.outputs.digest }}
175+
push-to-registry: true
176+
165177
manifest:
166178
needs: [ prepare, build ]
167179
runs-on: ubuntu-latest
180+
permissions:
181+
id-token: write
182+
contents: read
183+
attestations: write
184+
packages: write
168185
env:
169186
tag: ${{ needs.prepare.outputs.tag }}
170187
steps:
@@ -193,4 +210,11 @@ jobs:
193210
tags: ${{ env.tag }}
194211
username: ${{ secrets.registry_username }}
195212
password: ${{ secrets.registry_password }}
196-
registry: ${{ inputs.registry }}
213+
registry: ${{ inputs.registry }}
214+
215+
- name: Generate artifact attestation
216+
uses: actions/attest-build-provenance@v2
217+
with:
218+
subject-name: ${{ inputs.registry }}/${{ inputs.image_name }}:${{ env.tag }}
219+
subject-digest: ${{ steps.push.outputs.digest }}
220+
push-to-registry: true

0 commit comments

Comments
 (0)