-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) 路 1.73 KB
/
Copy pathbuild-docs.yml
File metadata and controls
65 lines (55 loc) 路 1.73 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: Documentation Build
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Documentation Changes
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
# Step 1: Checkout code
- name: Checkout Code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
# Step 2: Check if documentation files changed
- name: Check for documentation changes
id: filter
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- \
'docs/' \
'.github/workflows/build-docs.yml')
if [ -n "$CHANGED" ]; then
echo "docs=true" >> "$GITHUB_OUTPUT"
else
echo "docs=false" >> "$GITHUB_OUTPUT"
fi
build:
name: Build Documentation
needs: changes
if: needs.changes.outputs.docs == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Enforce pinned npm dependencies
uses: miragon/pin-npm-dependencies@58fe24377aef66748a1444ff69ab05e3f938a798 # v1
with:
root-path: docs
- name: Install Dependencies
run: npm ci
working-directory: docs
- name: Build Documentation
run: npm run build
working-directory: docs