From 45132e2390d911c1f29481470eeadedb116dcf12 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 31 Jan 2024 16:16:45 +0100 Subject: [PATCH] Tag should always be present (#333) --- .github/workflows/build-test-gumtree.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test-gumtree.yml b/.github/workflows/build-test-gumtree.yml index 0c0f5673..93877a8a 100644 --- a/.github/workflows/build-test-gumtree.yml +++ b/.github/workflows/build-test-gumtree.yml @@ -86,6 +86,14 @@ jobs: with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx + - name: set docker image tag + id: set-tag + run: | + if [[ $GITHUB_REF == refs/tags/v* ]]; then + echo "IMAGE_TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" >> $GITHUB_ENV + else + echo "IMAGE_TAG=latest" >> $GITHUB_ENV + fi - name: check secrets presence id: checksecrets shell: bash @@ -103,15 +111,6 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: set docker image tag - id: set-tag - if: (steps.checksecrets.outputs.secretspresent == 'true') - run: | - if [[ $GITHUB_REF == refs/tags/v* ]]; then - echo "IMAGE_TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" >> $GITHUB_ENV - else - echo "IMAGE_TAG=latest" >> $GITHUB_ENV - fi - name: build and push docker image uses: docker/build-push-action@v5 with: