Skip to content

Commit 6b24e24

Browse files
github action - get tag name
1 parent a4a30aa commit 6b24e24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/docker-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,18 @@ jobs:
5959
cache-from: type=local,src=/tmp/.buildx-cache
6060
cache-to: type=local,dest=/tmp/.buildx-cache-new
6161

62+
- name: Production Get Tag Name
63+
if: startsWith(github.ref, 'refs/tags/v')
64+
uses: little-core-labs/get-git-tag@v3.0.1
65+
id: tagName
66+
6267
- name: Production Tag Build and push
6368
if: startsWith(github.ref, 'refs/tags/v')
6469
uses: docker/build-push-action@v2
6570
with:
6671
context: .
6772
push: true
68-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{ github.event.ref }}
73+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{ steps.tagName.outputs.tag }}
6974
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
7075
cache-from: type=local,src=/tmp/.buildx-cache
7176
cache-to: type=local,dest=/tmp/.buildx-cache-new

0 commit comments

Comments
 (0)