1
1
name : " Build OBaaS OpenJDK Base Image"
2
-
3
2
on :
4
3
schedule :
5
4
- cron : " 0 0 * * *"
6
5
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
-
19
6
env :
20
7
dst_img : openjdk-image-obaas
21
8
description : " OpenJDK OBaaS Image."
22
-
23
9
jobs :
24
10
obaas-image :
25
11
strategy :
26
12
matrix :
27
- base_version : ${{ github.event.inputs.base_version != '' && [github.event.inputs.base_version] || [ 17, 21, 24] }}
13
+ base_version : [ 17, 21, 24]
28
14
runs-on : ubuntu-latest
29
15
permissions :
30
16
packages : write
@@ -40,14 +26,12 @@ jobs:
40
26
registry : ghcr.io
41
27
username : ${{ github.actor }}
42
28
password : ${{ secrets.GITHUB_TOKEN }}
43
-
44
29
- name : Get latest Image Software Digest
45
30
run : |
46
31
latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
47
32
echo "Current Digest: $latest_digest"
48
33
echo "latest_digest=$latest_digest" >> $GITHUB_ENV
49
34
continue-on-error : true
50
-
51
35
- name : Create New Image
52
36
if : github.event_name == 'workflow_dispatch' || env.latest_digest == ''
53
37
uses : ./.github/actions/process-image-openjdk
69
53
--password ${{ secrets.GITHUB_TOKEN }}
70
54
ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
71
55
continue-on-error : true
72
-
73
56
- name : Update Existing Image
74
57
id : update_image
75
58
if : env.latest_digest != '' && steps.trivy_scan.outcome == 'failure'
@@ -80,15 +63,13 @@ jobs:
80
63
description : ${{ env.description }}
81
64
push : false
82
65
pkg_command : dnf
83
-
84
66
- name : Get newest Image Software Digest
85
67
id : get_newest_digest
86
68
if : steps.update_image.outcome != 'skipped'
87
69
run : |
88
70
newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
89
71
echo "New Digest: $newest_digest"
90
72
echo "newest_digest=$newest_digest" >> $GITHUB_ENV
91
-
92
73
- name : Push Updated Image
93
74
if : steps.get_newest_digest.outcome != 'skipped' && env.latest_digest != env.newest_digest
94
75
uses : ./.github/actions/process-image-openjdk
0 commit comments