-
Notifications
You must be signed in to change notification settings - Fork 568
47 lines (44 loc) · 1.7 KB
/
Copy pathdocs-build.yml
File metadata and controls
47 lines (44 loc) · 1.7 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
name: Docs Build and Test
on:
pull_request:
branches:
- main
permissions: {}
# Stale runs for a PR are worthless once a new commit lands.
concurrency:
group: docs-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22'
# Root deps are required: docusaurus-plugin-typedoc reads ../src/*.ts
# and needs the root dependency types to resolve.
- name: Install root dependencies
run: npm ci
- name: Install docs dependencies
run: npm ci
working-directory: docs
- name: Build docs
run: npm run build
working-directory: docs
- name: Validate links and anchors
# Docusaurus baseUrl is /javascript/, so all internal links are emitted
# as /javascript/... . hyperlink treats the given dir as server root "/",
# so the build must be staged under a matching javascript/ subdirectory
# for site-absolute links to resolve.
run: |
rm -rf _linkcheck
mkdir -p _linkcheck/javascript
cp -R docs/build/. _linkcheck/javascript/
npx @untitaker/hyperlink _linkcheck --check-anchors