11name : " Build OBaaS OpenJDK Base Image"
2-
32on :
43 schedule :
54 - cron : " 0 0 * * *"
65 workflow_dispatch :
7- inputs :
8- base_version :
9- description : " Select the OpenJDK version to build (leave empty to build all versions)"
10- required : false
11- default : " "
12- type : choice
13- options :
14- - " "
15- - " 17"
16- - " 21"
17- - " 24"
18-
196env :
207 dst_img : openjdk-image-obaas
218 description : " OpenJDK OBaaS Image."
22-
239jobs :
2410 obaas-image :
2511 strategy :
2612 matrix :
27- base_version : ${{ github.event.inputs.base_version != '' && [github.event.inputs.base_version] || [ 17, 21, 24] }}
13+ base_version : [ 17, 21, 24]
2814 runs-on : ubuntu-latest
2915 permissions :
3016 packages : write
@@ -40,14 +26,12 @@ jobs:
4026 registry : ghcr.io
4127 username : ${{ github.actor }}
4228 password : ${{ secrets.GITHUB_TOKEN }}
43-
4429 - name : Get latest Image Software Digest
4530 run : |
4631 latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
4732 echo "Current Digest: $latest_digest"
4833 echo "latest_digest=$latest_digest" >> $GITHUB_ENV
4934 continue-on-error : true
50-
5135 - name : Create New Image
5236 if : github.event_name == 'workflow_dispatch' || env.latest_digest == ''
5337 uses : ./.github/actions/process-image-openjdk
6953 --password ${{ secrets.GITHUB_TOKEN }}
7054 ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
7155 continue-on-error : true
72-
7356 - name : Update Existing Image
7457 id : update_image
7558 if : env.latest_digest != '' && steps.trivy_scan.outcome == 'failure'
@@ -80,15 +63,13 @@ jobs:
8063 description : ${{ env.description }}
8164 push : false
8265 pkg_command : dnf
83-
8466 - name : Get newest Image Software Digest
8567 id : get_newest_digest
8668 if : steps.update_image.outcome != 'skipped'
8769 run : |
8870 newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
8971 echo "New Digest: $newest_digest"
9072 echo "newest_digest=$newest_digest" >> $GITHUB_ENV
91-
9273 - name : Push Updated Image
9374 if : steps.get_newest_digest.outcome != 'skipped' && env.latest_digest != env.newest_digest
9475 uses : ./.github/actions/process-image-openjdk
0 commit comments