Skip to content

Commit b1a36af

Browse files
committed
try again
1 parent 6243e0c commit b1a36af

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

.github/workflows/openjdk-base-image.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
base_version:
9-
description: "Select the OpenJDK version to build (leave empty to build all versions)"
9+
description: "OpenJDK version to build (leave empty to build all)"
1010
required: false
1111
default: ""
1212

@@ -18,7 +18,7 @@ jobs:
1818
obaas-image:
1919
strategy:
2020
matrix:
21-
base_version: [17, 21, 24]
21+
base_version: ${{ github.event.inputs.base_version != '' && [ github.event.inputs.base_version ] || [17,21,24] }}
2222
runs-on: ubuntu-latest
2323
permissions:
2424
packages: write
@@ -35,20 +35,9 @@ jobs:
3535
username: ${{ github.actor }}
3636
password: ${{ secrets.GITHUB_TOKEN }}
3737

38-
- name: Determine OpenJDK version
39-
id: version
40-
run: |
41-
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.base_version }}" ]; then
42-
echo "Using manual version ${{ github.event.inputs.base_version }}"
43-
echo "VERSION=${{ github.event.inputs.base_version }}" >> $GITHUB_ENV
44-
else
45-
echo "Using matrix version ${{ matrix.base_version }}"
46-
echo "VERSION=${{ matrix.base_version }}" >> $GITHUB_ENV
47-
fi
48-
4938
- name: Get latest Image Software Digest
5039
run: |
51-
latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.VERSION }} /image_digest || true)
40+
latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }} /image_digest || true)
5241
echo "Current Digest: $latest_digest"
5342
echo "latest_digest=$latest_digest" >> $GITHUB_ENV
5443
continue-on-error: true
@@ -57,8 +46,8 @@ jobs:
5746
if: github.event_name == 'workflow_dispatch' || env.latest_digest == ''
5847
uses: ./.github/actions/process-image-openjdk
5948
with:
60-
src_image: container-registry.oracle.com/java/openjdk:${{ env.VERSION }}
61-
dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.VERSION }}
49+
src_image: container-registry.oracle.com/java/openjdk:${{ matrix.base_version }}
50+
dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ matrix.base_version }}
6251
description: ${{ env.description }}
6352
push: true
6453
pkg_command: dnf

0 commit comments

Comments
 (0)