5151 platforms : ${{ inputs.image_platform }}
5252 - name : build image (Paketo Buildpack)
5353 run : |
54- OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
54+ if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
55+ OS_ARCH="aarch64"
56+ else
57+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
58+ fi
5559 ./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 }}
5660 - name : Login to GitHub Container Registry
5761 if : github.ref == inputs.target_ref
@@ -63,14 +67,22 @@ jobs:
6367 - name : docker push
6468 if : github.ref == inputs.target_ref
6569 run : |
66- OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
70+ if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
71+ OS_ARCH="aarch64"
72+ else
73+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
74+ fi
6775 docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA}
6876 docker tag ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA} ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
6977 docker push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}
7078 - name : Generate digest
7179 if : github.ref == inputs.target_ref
7280 run : |
73- OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
81+ if [[ "${{ inputs.image_platform }}" == "linux/arm64" && "${{ inputs.use_qemu }}" == "true" ]]; then
82+ OS_ARCH="aarch64"
83+ else
84+ OS_ARCH=$(./mvnw -f ${{ inputs.pom_dir }} help:evaluate -Dexpression=os.arch -q -DforceStdout)
85+ fi
7486 cat <<EOF > ${{ inputs.image_file }}
7587 image: $(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:jvm_${OS_ARCH}_${GITHUB_SHA})
7688 git_revision: ${GITHUB_SHA}
0 commit comments