Skip to content

Commit a639bb5

Browse files
authored
Update container build workflow (#705)
Update container build workflow to conditionally build images based on PR label.
1 parent f684e29 commit a639bb5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/publish-docker.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
paths-ignore:
1717
- 'docs/**'
1818
- '**/*.md'
19+
types: [labeled, unlabeled, opened, synchronize, reopened]
1920

2021
jobs:
2122
buildAndPush:
@@ -26,6 +27,14 @@ jobs:
2627
target: ceph-bucket-provider
2728
- name: ceph-volume-provider
2829
target: ceph-volume-provider
30+
permissions:
31+
contents: read
32+
packages: write
33+
# Condition: Run on push to main, published release, OR PR with 'ok-to-image' label
34+
if: |
35+
github.event_name == 'push' ||
36+
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ok-to-image')) ||
37+
(github.event_name == 'release' && github.event.action == 'published')
2938
runs-on: ubuntu-latest
3039
steps:
3140
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)