-
Notifications
You must be signed in to change notification settings - Fork 18
102 lines (83 loc) · 2.59 KB
/
Copy pathdocs.yml
File metadata and controls
102 lines (83 loc) · 2.59 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Docs
on:
pull_request:
branches: [main, dev]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
push:
branches: [main, dev]
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Do not cancel an in-flight production deploy when another push lands.
cancel-in-progress: ${{ github.event_name != 'push' }}
permissions:
contents: read
env:
NODE_VERSION: '24'
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check links and doc IDs
run: npm run test
- name: Build site
env:
CI: true
run: npm run build
deploy:
name: Deploy to GitHub Pages
needs: validate
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read # checkout (job permissions replace the workflow defaults)
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
defaults:
run:
working-directory: docs
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
with:
# Action paths are relative to the repo root, not defaults.run.working-directory.
path: docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4