From ba8c4c9a81dcfe59eb8f32045b814c0d92e53c9c Mon Sep 17 00:00:00 2001 From: Tim Pietrusky Date: Wed, 24 Jul 2024 12:05:06 +0200 Subject: [PATCH] ci: correctly handle the tag name --- .github/workflows/dev.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 63b3efb..c2630a0 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -40,9 +40,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set branch name as tag + id: get_tag + run: echo "::set-output name=tag::${GITHUB_REF##*/}" | sed 's/\//-/g' + - name: Build and push uses: docker/build-push-action@v5 with: push: true tags: | - ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ github.ref_name | replace('/', '-') }} + ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ steps.get_tag.outputs.tag }}