-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (53 loc) · 1.76 KB
/
pull_request_docs_preview.yml
File metadata and controls
65 lines (53 loc) · 1.76 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
65
name: "🦕 Docusaurus Documentation Website (PR Preview)"
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- closed
permissions:
contents: write
pull-requests: write
defaults:
run:
working-directory: website
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: website/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build website
run: npm run build
env:
DOCUSAURUS_BASE_URL: /pr-preview/pr-${{ github.event.pull_request.number }}/
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./website/build/
# - name: Comment PR
# uses: actions/github-script@v7
# with:
# script: |
# const url = `https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/`;
# const comment = `### 📖 Documentation Preview
# The documentation preview for this PR is available at:
# ${url}
# This preview will be updated automatically when the PR is updated.`;
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: comment
# });