Skip to content

Commit

Permalink
Use github.ref_name to get the tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisferrand committed Nov 30, 2021
1 parent 9e2a4a9 commit 32df6c1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ jobs:
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: "${{ env.DOCKER_IMAGE }}:${{ env.RELEASE_VERSION }}"
tags: "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}"
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -42,5 +39,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}

0 comments on commit 32df6c1

Please sign in to comment.