Skip to content

Commit b3e98ce

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

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ 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.event_name }}" == "push" ] && [[ "${{ github.ref }}" == refs/tags/v* ]]; then
94-
TAG="${{ github.ref_name#refs/tags/ }}"
93+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
94+
TAG="${{ github.ref#refs/tags/ }}"
9595
else
9696
TAG="${{ github.sha }}"
9797
fi
@@ -100,6 +100,7 @@ jobs:
100100
docker push ghcr.io/${{ github.repository }}/action:latest
101101
docker push ghcr.io/${{ github.repository }}/action:$TAG
102102
103+
103104
# Push Docker image to GitHub Container Registry
104105
- name: Push Docker image
105106
run: |

0 commit comments

Comments
 (0)