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
5
2
6
3
on :
7
4
push :
5
+ branches :
6
+ - ' main' # Trigger on push to main branch
8
7
tags :
9
8
- ' v*.*.*' # Trigger on tags like v1.0.0
10
9
@@ -26,11 +25,11 @@ jobs:
26
25
with :
27
26
images : ghcr.io/vishalmakwana111/inbox-zero
28
27
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') }}
34
33
- name : Log in to GitHub Container Registry
35
34
uses : docker/login-action@v3
36
35
with :
0 commit comments