Skip to content

Commit 8118c41

Browse files
chore(docker): update publish-docker.yml to trigger on main branch pushes and refine tagging logic for versioned releases
1 parent 2b15101 commit 8118c41

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/publish-docker.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# GitHub Actions workflow for building and publishing Docker images
2-
# See CICD_PLAN.md for details
3-
4-
name: Publish Docker Image
1+
name: Publish Docker Image
52

63
on:
74
push:
5+
branches:
6+
- 'main' # Trigger on push to main branch
87
tags:
98
- 'v*.*.*' # Trigger on tags like v1.0.0
109

@@ -26,11 +25,11 @@ jobs:
2625
with:
2726
images: ghcr.io/vishalmakwana111/inbox-zero
2827
tags: |
29-
type=semver,pattern={{version}} # e.g., v1.2.3
30-
type=semver,pattern={{major}}.{{minor}} # e.g., v1.2
31-
# type=sha # Optional: Add tag for git SHA
32-
# set latest tag for default branch - this requires triggering on push to main as well
33-
# type=raw,value=latest,enable={{is_default_branch}}
28+
# Push main branch commits as latest
29+
type=raw,value=latest,enable={{is_default_branch}}
30+
# Push version tags like v1.2.3, v1.2 for tags starting with v
31+
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
32+
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
3433
- name: Log in to GitHub Container Registry
3534
uses: docker/login-action@v3
3635
with:

0 commit comments

Comments
 (0)