Skip to content

Commit 41b6163

Browse files
committed
ci: add path-based conditions to skip irrelevant builds
- Add path filters to build.yaml for push/PR events - Add path filters to deploy.yaml for push events - Only run workflows when Go code or build files change
1 parent c81bcec commit 41b6163

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
on: [push]
1+
on:
2+
push:
3+
paths:
4+
- '**/*.go'
5+
- 'go.mod'
6+
- 'go.sum'
7+
- 'Makefile'
8+
- 'Dockerfile'
9+
- '.github/workflows/build.yaml'
10+
pull_request:
11+
paths:
12+
- '**/*.go'
13+
- 'go.mod'
14+
- 'go.sum'
15+
- 'Makefile'
16+
- 'Dockerfile'
17+
- '.github/workflows/build.yaml'
218

319
jobs:
420
build:

.github/workflows/deploy.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ on:
44
- 'v*'
55
branches:
66
- main
7+
paths:
8+
- '**/*.go'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- 'Makefile'
12+
- 'Dockerfile'
13+
- '.github/workflows/deploy.yaml'
714

815
env:
916
REGISTRY_IMAGE: ghcr.io/raeperd/kickstart

0 commit comments

Comments
 (0)