-
Notifications
You must be signed in to change notification settings - Fork 9
64 lines (55 loc) · 1.86 KB
/
Copy pathpr-preview.yml
File metadata and controls
64 lines (55 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy PR documentation preview
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
# Previews are written to the gh-pages branch under pr-preview/pr-<N>/.
# Production deploys (deploy.yml) preserve that directory via clean-exclude.
#
# Requirements (one-time repo settings):
# - Pages: Deploy from a branch → gh-pages / (root)
# - Actions → General → Workflow permissions → Read and write permissions
#
# Fork PRs are not supported by rossjrw/pr-preview-action (same-repo PRs only).
concurrency:
group: pages-preview-${{ github.event.number }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Set up Node.js
if: github.event.action != 'closed'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: npm
- name: Install dependencies
if: github.event.action != 'closed'
run: npm ci
- name: Build documentation preview
if: github.event.action != 'closed'
env:
# Org site (eval-hub.github.io) is served from the domain root.
ASTRO_BASE: /pr-preview/pr-${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run build
- name: Deploy or remove preview
uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1
with:
source-dir: ./dist/
preview-branch: gh-pages
umbrella-dir: pr-preview
pages-base-url: eval-hub.github.io
wait-for-pages-deployment: true
qr-code: false