Skip to content

Commit 089492e

Browse files
committed
Add github sha tag to image
1 parent b3e98ce commit 089492e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/ci.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,20 @@ jobs:
8787
- name: Build Docker image
8888
run: docker build -t ghcr.io/${{ github.repository }}/action:latest .
8989

90-
# Tag the Docker image with the GitHub tag or commit SHA
90+
# Tag the Docker image with the GitHub tag or commit SHA
9191
- name: Tag Docker image
9292
run: |
93-
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
94-
TAG="${{ github.ref#refs/tags/ }}"
93+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
94+
TAG="${{ github.ref##refs/tags/ }}"
9595
else
9696
TAG="${{ github.sha }}"
9797
fi
9898
echo "Using tag: $TAG"
9999
docker tag ghcr.io/${{ github.repository }}/action:latest ghcr.io/${{ github.repository }}/action:$TAG
100100
docker push ghcr.io/${{ github.repository }}/action:latest
101101
docker push ghcr.io/${{ github.repository }}/action:$TAG
102-
102+
103+
103104

104105
# Push Docker image to GitHub Container Registry
105106
- name: Push Docker image

0 commit comments

Comments
 (0)