Skip to content

Commit b2a39d2

Browse files
authored
ci: gate PR preview builds (#603)
* ci: gate PR preview builds * ci: include setup action in preview trigger
1 parent 233df07 commit b2a39d2

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Cleanup PR previews
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
concurrency: preview-${{ github.ref }}
9+
10+
jobs:
11+
cleanup-preview:
12+
if: github.event.pull_request.head.repo.full_name == github.repository
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
pages: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
21+
with:
22+
persist-credentials: true
23+
24+
- name: Remove preview
25+
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1
26+
with:
27+
source-dir: website/doc_build
28+
preview-branch: gh-pages
29+
qr-code: true
30+
wait-for-pages-deployment: true

.github/workflows/pr-preview.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ on:
66
- opened
77
- reopened
88
- synchronize
9-
- closed
9+
paths:
10+
- "website/**"
11+
- ".github/actions/build-docs/action.yml"
12+
- ".github/actions/setup-node-pnpm/action.yml"
13+
- ".github/workflows/pr-preview.yml"
14+
- "package.json"
15+
- "pnpm-lock.yaml"
16+
- "pnpm-workspace.yaml"
1017

1118
concurrency: preview-${{ github.ref }}
1219

0 commit comments

Comments
 (0)