Skip to content

Commit e538896

Browse files
committed
ci: build & push on main
1 parent d3c212e commit e538896

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build-docker.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
type: boolean
1010
default: true
1111
push:
12+
branches: [main]
1213
tags:
1314
- "v*"
1415
pull_request:
@@ -63,13 +64,12 @@ jobs:
6364
with:
6465
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6566
tags: |
66-
type=ref,event=branch
67-
type=ref,event=pr
67+
type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }}
68+
type=sha,prefix=,format=short,enable=${{ github.ref == 'refs/heads/main' }}
6869
type=semver,pattern={{version}}
6970
type=semver,pattern={{major}}.{{minor}}
7071
type=semver,pattern={{major}}
71-
type=sha,prefix={{branch}}-,enable={{is_default_branch}}
72-
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
72+
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
7373
7474
- name: Login to GitHub Container Registry
7575
if: github.event_name != 'pull_request'
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
context: .
8686
platforms: linux/amd64,linux/arm64
87-
push: ${{ github.event_name != 'pull_request' && (inputs.push || startsWith(github.ref, 'refs/tags/v')) }}
87+
push: ${{ github.event_name != 'pull_request' && (inputs.push || startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }}
8888
provenance: false
8989
tags: |
9090
${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)