From 30d13f87fedb30386596e1f2973dccc298071578 Mon Sep 17 00:00:00 2001 From: Marek Aufart Date: Fri, 16 Feb 2024 16:53:08 +0100 Subject: [PATCH] Fix version variables evaluation in github build (#156) Fix version variables evaluation in build Using github variables to provide version and commit sha variables for build. Follow-up to https://github.com/konveyor/kantra/pull/154 Signed-off-by: Marek Aufart --- .github/workflows/multi-arch-image-build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/multi-arch-image-build.yaml b/.github/workflows/multi-arch-image-build.yaml index fc3a031..322e8c5 100644 --- a/.github/workflows/multi-arch-image-build.yaml +++ b/.github/workflows/multi-arch-image-build.yaml @@ -26,9 +26,8 @@ jobs: sed -i "s,FROM quay.io/konveyor/windup-shim\:latest,FROM quay.io/konveyor/windup-shim:${TAG}," Dockerfile sed -i "s,FROM quay.io/konveyor/static-report\:latest,FROM quay.io/konveyor/static-report:${TAG}," Dockerfile sed -i "s,FROM quay.io/konveyor/analyzer-lsp\:latest,FROM quay.io/konveyor/analyzer-lsp:${TAG}," Dockerfile - export BUILD_COMMIT=$(git rev-parse HEAD) extra-args: | - --build-arg VERSION=${tag} --build-arg BUILD_COMMIT=${BUILD_COMMIT} + --build-arg VERSION=${{ github.ref == 'refs/heads/main' && 'latest' || github.ref_name }} --build-arg BUILD_COMMIT=${{ github.sha }} secrets: registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }} registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }}