From e0b40ed4336bd2929e866652f429a6639ad090d1 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Sat, 3 Aug 2024 16:23:08 +0200 Subject: [PATCH] fix: fix github action by getting tag name --- .github/workflows/release.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 206af8e..cf5ffff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: push: tags: - - v** + - v** env: BUILDKIT_IMAGE: jkaninda/mysql-bkup jobs: @@ -12,13 +12,13 @@ jobs: packages: write contents: read steps: - - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - + - name: Login to DockerHub uses: docker/login-action@v3 with: @@ -30,6 +30,10 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - + name: Get the tag name + id: get_tag_name + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Build and push uses: docker/build-push-action@v3 @@ -38,8 +42,8 @@ jobs: file: "./docker/Dockerfile" platforms: linux/amd64,linux/arm64,linux/arm/v7 tags: | - "${{env.BUILDKIT_IMAGE}}:${{env.GITHUB_REF_NAME}}" - "${{env.BUILDKIT_IMAGE}}:latest" - "ghcr.io/${{env.BUILDKIT_IMAGE}}:${{env.GITHUB_REF_NAME}}" - "ghcr.io/${{env.BUILDKIT_IMAGE}}:latest" + "${{env.BUILDKIT_IMAGE}}:${{ env.TAG_NAME }}" + "${{env.BUILDKIT_IMAGE}}:latest" + "ghcr.io/${{env.BUILDKIT_IMAGE}}:${{ env.TAG_NAME }}" + "ghcr.io/${{env.BUILDKIT_IMAGE}}:latest"