Skip to content

Commit 5c14f08

Browse files
authored
Only run container builds in PR when ok-to-image label is present (#187)
1 parent fdd44d6 commit 5c14f08

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/publish-docker.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ env:
44
platforms: linux/amd64,linux/arm64
55

66
on:
7+
release:
8+
types:
9+
- published
710
push:
811
branches:
9-
- main
12+
- main
1013
tags:
11-
- v*
14+
- v*
15+
paths-ignore:
16+
- 'docs/**'
17+
- '**/*.md'
1218
pull_request:
1319
paths-ignore:
1420
- 'docs/**'
@@ -22,6 +28,11 @@ permissions:
2228
jobs:
2329
publish-docker:
2430
name: Build and publish Docker image
31+
# Condition: Run on push to main, published release, OR PR with 'ok-to-image' label
32+
if: |
33+
github.event_name == 'push' ||
34+
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ok-to-image')) ||
35+
(github.event_name == 'release' && github.event.action == 'published')
2536
runs-on: ubuntu-latest
2637
steps:
2738
- name: Check out repository

0 commit comments

Comments
 (0)