66 - cron : ' 5 3 * * *' # 3am-ish UTC everyday (timed against official fedora container pushes)
77 workflow_dispatch :
88
9+ env :
10+ REGISTRY : ghcr.io
11+
912jobs :
1013 build-custom-silverblue :
1114 name : Build, sign, then push
1215 runs-on : ubuntu-24.04
1316 permissions :
17+ attestations : write
1418 contents : read
15- packages : write
1619 id-token : write
20+ packages : write
1721
1822 steps :
1923 - name : Checkout
2024 uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
21-
22- - name : Install cosign
23- if : ${{ github.event_name != 'pull_request' }}
24- uses : sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
25- with :
26- cosign-release : ' v2.4.1'
2725
2826 - name : Build image
2927 id : build
@@ -35,14 +33,14 @@ jobs:
3533 tags : |
3634 ${{ github.sha }}
3735 40
38-
36+
3937 - name : Log in to GitHub Container Registry
4038 uses : redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
4139 if : ${{ github.event_name != 'pull_request' }}
4240 with :
4341 username : ${{ github.actor }}
4442 password : ${{ secrets.GITHUB_TOKEN }}
45- registry : ghcr.io /${{ github.repository_owner }}
43+ registry : ${{ env.REGISTRY }} /${{ github.repository_owner }}
4644
4745 - name : Push to GitHub Container Registry
4846 uses : redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
@@ -51,17 +49,15 @@ jobs:
5149 with :
5250 image : ${{ steps.build.outputs.image }}
5351 tags : ${{ steps.build.outputs.tags }}
54- registry : ghcr.io /${{ github.repository_owner }}
52+ registry : ${{ env.REGISTRY }} /${{ github.repository_owner }}
5553
56- - name : Sign the published OCI image
54+ - name : Generate artifact attestation
55+ uses : actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
5756 if : ${{ github.event_name != 'pull_request' }}
58- env :
59- digest : ${{ steps.push.outputs.digest }}
60- fully_qualified_image_names_json : ${{ steps.push.outputs.registry-paths }}
61- run : >
62- echo "${fully_qualified_image_names_json}"
63- | jq -r '.[]'
64- | xargs -I {} cosign sign --yes "{}@${digest}"
57+ with :
58+ subject-name : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ steps.build.outputs.image }}
59+ subject-digest : ${{ steps.push.outputs.digest }}
60+ push-to-registry : true
6561
6662 - name : Echo outputs for auditing
6763 if : github.event_name != 'pull_request'
0 commit comments