Skip to content

Commit 1517eea

Browse files
authored
Merge pull request #25 from natrontech/ci/improvements
ci: simplify docker tag logic
2 parents 477baf5 + 312ee5c commit 1517eea

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
push:
77
tags:
88
- "v*"
9+
branches:
10+
- main
911
## uncomment if you want to release on PR merge
1012
# pull_request:
1113
# branches:
@@ -49,13 +51,10 @@ jobs:
4951
with:
5052
images: ghcr.io/${{ github.repository }}
5153
tags: |
52-
# If triggered by a schedule on main -> Tag as latest
53-
type=raw,value=latest,enable={{ github.event_name == 'schedule' && github.ref_name == 'main' }}
54-
55-
# If tag push (e.g., v1.2.3) -> Create both versioned tag and latest
54+
# set latest tag for default branch
55+
type=raw,value=latest,enable={{is_default_branch}}
56+
# tag
5657
type=ref,event=tag
57-
type=raw,value=latest,enable={{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
58-
5958
# If pull request event
6059
type=ref,event=pr
6160
- name: Build and push Docker image

0 commit comments

Comments
 (0)