Skip to content

Commit 6b92632

Browse files
changed the determine tag name based on branch condition
1 parent 8136d30 commit 6b92632

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/docker-build-and-push.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ jobs:
5050
- name: Determine Tag Name Based on Branch
5151
id: determine_tag
5252
run: |
53-
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
54-
echo "tagname=latest" >> $GITHUB_ENV
55-
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
56-
echo "tagname=dev" >> $GITHUB_ENV
57-
elif [[ "${{ github.ref }}" == "refs/heads/demo" ]]; then
58-
echo "tagname=demo" >> $GITHUB_ENV
53+
if [[ "${{ github.ref_name }}" == "main" ]]; then
54+
echo "tagname=latest" >> $GITHUB_OUTPUT
55+
elif [[ "${{ github.ref_name }}" == "dev" ]]; then
56+
echo "tagname=dev" >> $GITHUB_OUTPUT
57+
elif [[ "${{ github.ref_name }}" == "demo" ]]; then
58+
echo "tagname=demo" >> $GITHUB_OUTPUT
5959
else
60-
echo "tagname=pullrequest-ignore" >> $GITHUB_ENV
60+
echo "tagname=default" >> $GITHUB_OUTPUT
61+
6162
fi
6263
6364
- name: Build Docker Image and optionally push

0 commit comments

Comments
 (0)