4
4
- cron : " 0 0 * * *"
5
5
workflow_dispatch :
6
6
env :
7
- src_tag : 17- muslib-ol8
7
+ src_tag_suffix : muslib-ol8
8
8
dst_img : graalvm-native-image-obaas
9
- description : " Oracle GraalVM for JDK 17 and OBaaS."
9
+ description : " Oracle GraalVM and OBaaS."
10
10
jobs :
11
11
obaas-image :
12
+ strategy :
13
+ matrix :
14
+ base_version : [17, 21]
12
15
runs-on : ubuntu-latest
13
16
permissions :
14
17
packages : write
27
30
28
31
- name : Get latest Image Software Digest
29
32
run : |
30
- latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest /image_digest)
33
+ latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
31
34
echo "Current Digest: $latest_digest"
32
35
echo "latest_digest=$latest_digest" >> $GITHUB_ENV
33
36
continue-on-error : true
36
39
if : env.latest_digest == ''
37
40
uses : ./.github/actions/process-image
38
41
with :
39
- src_image : container-registry.oracle.com/graalvm/native-image:${{ env.src_tag }}
40
- dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
42
+ src_image : container-registry.oracle.com/graalvm/native-image:${{ matrix.base_version }}-${{ env.src_tag_suffix }}
43
+ dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}-${{ env.src_tag_suffix }}
41
44
description : ${{ env.description }}
42
45
push : true
43
46
@@ -51,32 +54,32 @@ jobs:
51
54
docker run --rm ghcr.io/aquasecurity/trivy:latest image $TRIVY_DEFAULT $TRIVY_SCAN
52
55
--username ${{ github.actor }}
53
56
--password ${{ secrets.GITHUB_TOKEN }}
54
- ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
57
+ ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
55
58
continue-on-error : true
56
59
57
60
- name : Update Existing Image
58
61
id : update_image
59
62
if : env.latest_digest != '' && steps.trivy_scan.outcome == 'failure'
60
63
uses : ./.github/actions/process-image
61
64
with :
62
- src_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
63
- dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
65
+ src_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
66
+ dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}-${{ env.src_tag_suffix }}
64
67
description : ${{ env.description }}
65
68
push : false
66
69
67
70
- name : Get newest Image Software Digest
68
71
id : get_newest_digest
69
72
if : steps.update_image.outcome != 'skipped'
70
73
run : |
71
- newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest /image_digest)
74
+ newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest)
72
75
echo "New Digest: $newest_digest"
73
76
echo "newest_digest=$newest_digest" >> $GITHUB_ENV
74
77
75
78
- name : Push Updated Image
76
79
if : steps.get_newest_digest.outcome != 'skipped' && env.latest_digest != env.newest_digest
77
80
uses : ./.github/actions/process-image
78
81
with :
79
- src_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
80
- dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
82
+ src_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
83
+ dst_image : ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}-${{ env.src_tag_suffix }}
81
84
description : ${{ env.description }}
82
85
push : true
0 commit comments