Skip to content

Commit 1a01b7d

Browse files
committed
feat: improve pr doc deployment with labelling strategy
1 parent 30b4da8 commit 1a01b7d

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/labeler.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ dependencies:
1515
CI/CD:
1616
- docker/**/*
1717
- .github/**/*
18-
- .ci/**/*
18+
- .ci/**/*
19+
20+
# HACK: the label is declared with the only purpose of avoiding the
21+
# GitHub labeler bot from removing it. This is a known issue reported in the
22+
# official action/labeler repo https://github.com/actions/labeler/issues/763
23+
'deploy-pr-doc':
24+
- all:
25+
- changed-files:
26+
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']

.github/labels.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- name: 'deploy-pr-doc'
2+
description: Deploy pull request documentation
3+
color: 00ff00

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review, closed]
5+
types: [opened, synchronize, reopened, ready_for_review, closed, labeled]
66
branches-ignore:
77
- '*no-ci*'
88
push:
@@ -159,7 +159,10 @@ jobs:
159159
name: "Deploy PR documentation"
160160
runs-on: ubuntu-latest
161161
needs: docs
162-
if: always() && (needs.docs.result == 'success' || needs.docs.result == 'skipped')
162+
if: |
163+
always() &&
164+
(needs.docs.result == 'success' || needs.docs.result == 'skipped') &&
165+
contains(github.event.pull_request.labels.*.name, 'deploy-pr-doc')
163166
steps:
164167
- uses: ansys/actions/doc-deploy-pr@v10
165168
with:

0 commit comments

Comments
 (0)