From b5957cef1b3aaf4c81a8a970e7901d70b234fc9d Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 3 Mar 2025 16:52:53 +1100 Subject: [PATCH] Update CI/CD to build the image with the appropriate tag --- .gitea/workflows/build_docker.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build_docker.yaml b/.gitea/workflows/build_docker.yaml index f3700c32..9660cd4a 100644 --- a/.gitea/workflows/build_docker.yaml +++ b/.gitea/workflows/build_docker.yaml @@ -2,7 +2,7 @@ name: Create Docker Image run-name: ${{ gitea.actor }} Building Docker Image 🐳 on: [push] env: - VERSION: latest + VERSION: ${GITHUB_REF_NAME} DOCKER_HOST: tcp://127.0.0.1:2375 jobs: @@ -145,12 +145,11 @@ jobs: - name: Record version and Delete Unnecessary files id: prebuild run: | - echo "version=$(cat public/VERSION)" >> "$GITHUB_OUTPUT" - echo "revision=${GITHUB_SHA}" >> "$GITHUB_OUTPUT" echo ${GITHUB_SHA::8} > VERSION + [ "${GITHUB_REF_TYPE}" -eq "tag" ] && echo v${{ env.VERSION }}-rel > public/VERSION rm -rf .git* tests/ storage/app/test/ - ls -al public/css/ - ls -al public/js/ + # ls -al public/css/ + # ls -al public/js/ - name: Build and Push Docker Image uses: docker/build-push-action@v5 @@ -160,8 +159,8 @@ jobs: push: true tags: "${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSIONARCH }}" build-args: | - BUILD_REVISION=${{ steps.prebuild.outputs.revision }} - BUILD_VERSION=${{ steps.prebuild.outputs.version }} + BUILD_REVISION=${GITHUB_SHA} + BUILD_VERSION=v${{ env.VERSION }} manifest: name: Final Docker Image Manifest