1
+ name : Publish images
2
+ permissions : {}
3
+
4
+ on :
5
+ push :
6
+ tags :
7
+ - " v*"
8
+
9
+ concurrency :
10
+ group : ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress : true
12
+
13
+ jobs :
14
+ publish-images :
15
+ runs-on : ubuntu-latest
16
+ permissions :
17
+ packages : write
18
+ id-token : write
19
+ outputs :
20
+ capsule-digest : ${{ steps.publish-capsule.outputs.digest }}
21
+ steps :
22
+ - name : Checkout
23
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24
+ - name : Setup caches
25
+ uses : ./.github/actions/setup-caches
26
+ timeout-minutes : 5
27
+ continue-on-error : true
28
+ with :
29
+ build-cache-key : publish-images
30
+ - name : Run Trivy vulnerability (Repo)
31
+ uses : aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0
32
+ with :
33
+ scan-type : ' fs'
34
+ ignore-unfixed : true
35
+ format : ' sarif'
36
+ output : ' trivy-results.sarif'
37
+ severity : ' CRITICAL,HIGH'
38
+ - name : Install Cosign
39
+ uses : sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
40
+ - name : Publish Capsule
41
+ id : publish-capsule
42
+ uses : oliverbaehler/github-actions/ko-publish-image@979018716f7d0cbe8d2711f572b350afad4ef211 # v0.1.1
43
+ with :
44
+ makefile-target : ko-publish-capsule
45
+ registry : ghcr.io
46
+ registry-username : ${{ github.actor }}
47
+ registry-password : ${{ secrets.GITHUB_TOKEN }}
48
+ repository : ${{ github.repository_owner }}
49
+ version : ${{ github.ref_name }}
50
+ sign-image : true
51
+ sbom-name : capsule
52
+ sbom-repository : ghcr.io/${{ github.repository_owner }}/sbom
53
+ signature-repository : ghcr.io/${{ github.repository_owner }}/signatures
54
+ main-path : ./
55
+ env :
56
+ REPOSITORY : ${{ github.repository }}
57
+ generate-capsule-provenance :
58
+ needs : publish-images
59
+ permissions :
60
+ id-token : write # To sign the provenance.
61
+ packages : write # To upload assets to release.
62
+ actions : read # To read the workflow path.
63
+ uses :
slsa-framework/slsa-github-generator/.github/workflows/[email protected]
64
+ with :
65
+ image : ghcr.io/${{ github.repository_owner }}/capsule
66
+ digest : " ${{ needs.publish-images.outputs.capsule-digest }}"
67
+ registry-username : ${{ github.actor }}
68
+ secrets :
69
+ registry-password : ${{ secrets.GITHUB_TOKEN }}
0 commit comments