Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
making committed Dec 16, 2024
1 parent 7766e9c commit dcf749e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/build-oci-image-jvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ jobs:
platforms: ${{ inputs.image_platform }}
- name: build image (Paketo Buildpack)
run: |
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
OS_ARCH="aarch64"
else
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
fi
./mvnw -V -f ${{ inputs.pom_dir }} --no-transfer-progress spring-boot:build-image -DskipTests -Dspring-boot.build-image.imageName=ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA} -Dspring-boot.build-image.imagePlatform=${{ inputs.image_platform }}
- name: Login to GitHub Container Registry
if: github.ref == inputs.target_ref
Expand All @@ -63,14 +67,22 @@ jobs:
- name: docker push
if: github.ref == inputs.target_ref
run: |
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
OS_ARCH="aarch64"
else
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
fi
docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA}
docker tag ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA} ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
- name: Generate digest
if: github.ref == inputs.target_ref
run: |
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
OS_ARCH="aarch64"
else
OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
fi
cat <<EOF > ${{ inputs.image_file }}
image: $(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA})
git_revision: ${GITHUB_SHA}
Expand Down

0 comments on commit dcf749e

Please sign in to comment.