Skip to content

Commit 402a2a2

Browse files
committed
actions fix
1 parent c94bd30 commit 402a2a2

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,11 @@ Thumbs.db
2727
README.md
2828
LICENSE
2929

30+
# CI/CD & non-app directories
31+
.github/
32+
k8s/
33+
docs/
34+
assets/
35+
3036
# Claude
3137
.claude/

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

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: Build and Push Docker Image
22

33
on:
44
push:
5-
branches: [main]
6-
tags: ['v*']
7-
pull_request:
8-
branches: [main]
5+
branches: [master]
6+
paths-ignore:
7+
- 'README.md'
8+
- 'LICENSE'
9+
- 'docs/**'
10+
- 'k8s/**'
11+
- 'assets/**'
12+
- '.github/**'
913

1014
env:
1115
REGISTRY: ghcr.io
@@ -26,30 +30,19 @@ jobs:
2630
uses: docker/setup-buildx-action@v3
2731

2832
- name: Log in to GitHub Container Registry
29-
if: github.event_name != 'pull_request'
3033
uses: docker/login-action@v3
3134
with:
3235
registry: ${{ env.REGISTRY }}
3336
username: ${{ github.actor }}
3437
password: ${{ secrets.GITHUB_TOKEN }}
3538

36-
- name: Extract metadata
37-
id: meta
38-
uses: docker/metadata-action@v5
39-
with:
40-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41-
tags: |
42-
type=ref,event=branch
43-
type=semver,pattern={{version}}
44-
type=semver,pattern={{major}}.{{minor}}
45-
type=sha
46-
4739
- name: Build and push
4840
uses: docker/build-push-action@v6
4941
with:
5042
context: .
51-
push: ${{ github.event_name != 'pull_request' }}
52-
tags: ${{ steps.meta.outputs.tags }}
53-
labels: ${{ steps.meta.outputs.labels }}
43+
push: true
44+
tags: |
45+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
46+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
5447
cache-from: type=gha
5548
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)