1
+ name : Publish images
2
+ permissions : {}
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*"
7
+ concurrency :
8
+ group : ${{ github.workflow }}-${{ github.ref }}
9
+ cancel-in-progress : true
10
+ jobs :
11
+ publish-images :
12
+ runs-on : ubuntu-latest
13
+ permissions :
14
+ packages : write
15
+ id-token : write
16
+ outputs :
17
+ container-digest : ${{ steps.publish.outputs.digest }}
18
+ steps :
19
+ - name : Checkout
20
+ uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
21
+ - name : " Extract Version"
22
+ id : extract_version
23
+ run : |
24
+ GIT_TAG=${GITHUB_REF##*/}
25
+ VERSION=${GIT_TAG##v}
26
+ echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT
27
+ - name : Run Trivy vulnerability (Repo)
28
+ uses : aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # v0.12.0
29
+ with :
30
+ scan-type : ' fs'
31
+ ignore-unfixed : true
32
+ format : ' sarif'
33
+ output : ' trivy-results.sarif'
34
+ severity : ' CRITICAL,HIGH'
35
+ - name : Install Cosign
36
+ uses : sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
37
+ - name : Publish with KO
38
+ id : publish
39
+ uses : oliverbaehler/github-actions/ko-publish-image@8dfd42735c85f6c58d5d4d6f3232cd0e39d1fe73 # v0.1.0
40
+ with :
41
+ makefile-target : ko-publish-all
42
+ registry : ghcr.io
43
+ registry-username : ${{ github.actor }}
44
+ registry-password : ${{ secrets.GITHUB_TOKEN }}
45
+ repository : ${{ github.repository_owner }}
46
+ version : ${{ steps.extract_version.outputs.version }}
47
+ sign-image : true
48
+ sbom-name : svc-ingress-propagator
49
+ sbom-repository : ghcr.io/${{ github.repository_owner }}/sbom
50
+ signature-repository : ghcr.io/${{ github.repository_owner }}/signatures
51
+ main-path : ./cmd/
52
+ env :
53
+ REPOSITORY : ${{ github.repository }}
54
+ VERSION : ${{ steps.extract_version.outputs.version }}
55
+ generate-provenance :
56
+ needs : publish-images
57
+ permissions :
58
+ id-token : write # To sign the provenance.
59
+ packages : write # To upload assets to release.
60
+ actions : read # To read the workflow path.
61
+ uses : slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
62
+ with :
63
+ image : ghcr.io/${{ github.repository_owner }}/svc-ingress-propagator
64
+ digest : " ${{ needs.publish-images.outputs.container-digest }}"
65
+ registry-username : ${{ github.actor }}
66
+ secrets :
67
+ registry-password : ${{ secrets.GITHUB_TOKEN }}
0 commit comments