77 branches :
88 - master
99 schedule :
10- - cron : ' 0 0 * * 0'
10+ - cron : ' 0 0 * * 0'
1111 workflow_dispatch :
1212
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
16+
1317jobs :
14- build_push_check :
15- name : Build docker image, publish it and run vuln scanner against it
18+ build_amd64 :
19+ name : Build amd64 images (push by digest)
1620 permissions :
17- contents : read # for actions/checkout to fetch code
18- security-events : write # for github/codeql-action/upload-sarif to upload SARIF results
19- packages : write # for image publication to GitHub Packages
20- runs-on : ubuntu-latest
21+ contents : read
22+ packages : write
23+ runs-on : ubuntu-24.04
2124 environment :
2225 name : ci-build
26+ outputs :
27+ latest_image_tag : ${{ steps.build.outputs.LATEST_IMAGE_TAG }}
2328 steps :
2429 - name : Checkout repository
2530 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
2631 - name : Set up Docker Buildx
27- id : buildx
2832 uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0
2933 - name : Login to ghcr.io
3034 uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # 4.1.0
@@ -45,20 +49,132 @@ jobs:
4549 run : ./build --test
4650 - name : Describe images
4751 run : ./build --describe >> $GITHUB_STEP_SUMMARY
48- - name : Push images
52+ - name : Push images by digest
53+ env :
54+ ORACLE_JAVA8_TOKEN : ${{ secrets.ORACLE_JAVA8_TOKEN }}
55+ run : ./build --push
56+ - name : Upload digest metadata
57+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
58+ with :
59+ name : digests-amd64
60+ path : digests/amd64-*.json
61+ if-no-files-found : error
62+ retention-days : 1
63+
64+ build_arm64 :
65+ name : Build arm64 images (push by digest)
66+ permissions :
67+ contents : read
68+ packages : write
69+ runs-on : ubuntu-24.04-arm
70+ environment :
71+ name : ci-build
72+ outputs :
73+ latest_image_tag : ${{ steps.build.outputs.LATEST_IMAGE_TAG }}
74+ steps :
75+ - name : Checkout repository
76+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
77+ - name : Set up Docker Buildx
78+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0
79+ - name : Login to ghcr.io
80+ uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # 4.1.0
81+ with :
82+ registry : ghcr.io
83+ username : ${{ github.actor }}
84+ password : ${{ secrets.GITHUB_TOKEN }}
85+ - name : Free Disk Space (Ubuntu)
86+ uses : jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
87+ with :
88+ docker-images : false
89+ - name : Build arm64 images
90+ id : build
91+ env :
92+ ORACLE_JAVA8_TOKEN : ${{ secrets.ORACLE_JAVA8_TOKEN }}
93+ PLATFORM : linux/arm64
94+ run : ./build
95+ - name : Test arm64 images
96+ env :
97+ PLATFORM : linux/arm64
98+ run : ./build --test
99+ - name : Describe arm64 images
100+ env :
101+ PLATFORM : linux/arm64
102+ run : ./build --describe >> $GITHUB_STEP_SUMMARY
103+ - name : Push arm64 images by digest
104+ env :
105+ ORACLE_JAVA8_TOKEN : ${{ secrets.ORACLE_JAVA8_TOKEN }}
106+ PLATFORM : linux/arm64
49107 run : ./build --push
50- - name : Run Trivy vulnerability scanner
108+ - name : Upload digest metadata
109+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
110+ with :
111+ name : digests-arm64
112+ path : digests/arm64-*.json
113+ if-no-files-found : error
114+ retention-days : 1
115+
116+ merge_manifests :
117+ name : Merge per-arch digests into multi-arch manifests
118+ needs : [build_amd64, build_arm64]
119+ permissions :
120+ contents : read
121+ security-events : write
122+ packages : write
123+ runs-on : ubuntu-24.04
124+ steps :
125+ - name : Checkout repository
126+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
127+ - name : Set up Docker Buildx
128+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0
129+ - name : Login to ghcr.io
130+ uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # 4.1.0
131+ with :
132+ registry : ghcr.io
133+ username : ${{ github.actor }}
134+ password : ${{ secrets.GITHUB_TOKEN }}
135+ - name : Download amd64 digests
136+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
137+ with :
138+ name : digests-amd64
139+ path : digests
140+ - name : Download arm64 digests
141+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
142+ with :
143+ name : digests-arm64
144+ path : digests
145+ - name : Create multi-arch manifests
146+ run : ./build --merge
147+ - name : Run Trivy vulnerability scanner (amd64)
148+ uses : aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
149+ with :
150+ image-ref : ' ${{ needs.build_amd64.outputs.latest_image_tag }}'
151+ format : ' sarif'
152+ output : ' trivy-results-amd64.sarif'
153+ severity : ' CRITICAL,HIGH'
154+ limit-severities-for-sarif : true
155+ env :
156+ TRIVY_DB_REPOSITORY : ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
157+ TRIVY_JAVA_DB_REPOSITORY : ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
158+ TRIVY_PLATFORM : linux/amd64
159+ - name : Upload amd64 Trivy results
160+ uses : github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
161+ with :
162+ sarif_file : ' trivy-results-amd64.sarif'
163+ category : trivy-amd64
164+ - name : Run Trivy vulnerability scanner (arm64)
51165 uses : aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
52166 with :
53- image-ref : ' ${{ steps.build .outputs.LATEST_IMAGE_TAG }}'
167+ image-ref : ' ${{ needs.build_arm64 .outputs.latest_image_tag }}'
54168 format : ' sarif'
55- output : ' trivy-results.sarif'
169+ output : ' trivy-results-arm64 .sarif'
56170 severity : ' CRITICAL,HIGH'
57171 limit-severities-for-sarif : true
58172 env :
59173 TRIVY_DB_REPOSITORY : ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
60174 TRIVY_JAVA_DB_REPOSITORY : ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
61- - name : Upload Trivy scan results to GitHub Security tab
175+ TRIVY_PLATFORM : linux/arm64
176+ - name : Upload arm64 Trivy results
62177 uses : github/codeql-action/upload-sarif@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
63178 with :
64- sarif_file : ' trivy-results.sarif'
179+ sarif_file : ' trivy-results-arm64.sarif'
180+ category : trivy-arm64
0 commit comments