From f6feaaed7357764f6fdbfaaed895a933535c2c61 Mon Sep 17 00:00:00 2001 From: Bernt Christian Egeland Date: Thu, 6 Apr 2023 21:02:37 +0000 Subject: [PATCH] app version --- .github/workflows/ci-tag.yml | 6 ++---- .github/workflows/dev_build.yml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-tag.yml b/.github/workflows/ci-tag.yml index cabbbc12..3d35a65f 100644 --- a/.github/workflows/ci-tag.yml +++ b/.github/workflows/ci-tag.yml @@ -40,10 +40,6 @@ jobs: id: previoustag uses: "WyriHaximus/github-action-get-previous-tag@v1" - - name: "set app version to env" - env: - NEXT_PUBLIC_APP_VERSION: ${{ steps.previoustag.outputs.tag }}" - - name: Extract version number id: extract_version run: | @@ -62,6 +58,8 @@ jobs: context: . file: ./Dockerfile push: true + build-args: | + "NEXT_PUBLIC_APP_VERSION=${{ steps.previoustag.outputs.tag }}" tags: | ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:latest ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ steps.extract_version.outputs.version_number }} diff --git a/.github/workflows/dev_build.yml b/.github/workflows/dev_build.yml index 3c5986fe..0f12be5e 100644 --- a/.github/workflows/dev_build.yml +++ b/.github/workflows/dev_build.yml @@ -63,16 +63,14 @@ jobs: - name: Create short sha run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV - - name: "set app version to env" - env: - NEXT_PUBLIC_APP_VERSION: v${{ github.ref_name }}-${{ env.SHORT_SHA }}" - - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: context: . push: true + build-args: | + "NEXT_PUBLIC_APP_VERSION=${{ steps.previoustag.outputs.tag }}" # platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: | ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}