-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 1.96 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
81 lines (65 loc) · 1.96 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
# Deploy marketing site (React) + docs (VitePress) to GitHub Pages
# React site serves at / — VitePress docs at /docs/
# Requires: GitHub Pages source set to "GitHub Actions" in repo Settings > Pages
name: Deploy Site & Docs
on:
push:
branches: [main]
paths:
- 'site/**'
- 'docs/**'
- 'package.json'
workflow_dispatch:
permissions:
pages: write
id-token: write
contents: read
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build Site & Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
# Install root deps (for VitePress) — use npm install instead of npm ci
# because the lock file is generated on Windows and may miss Linux optional deps
- name: Install root dependencies
run: npm install --ignore-scripts
# Install site deps — use npm install for same cross-platform reason as root
- name: Install site dependencies
run: cd site && npm install --legacy-peer-deps
# Build React landing site → site/dist/
- name: Build landing site
run: cd site && npm run build
# Build VitePress docs → docs/.vitepress/dist/
- name: Build docs
run: npm run docs:build
# Merge: React site at root, VitePress at /docs/
- name: Merge builds
run: |
mkdir -p _site
cp -r site/dist/* _site/
mkdir -p _site/docs
cp -r docs/.vitepress/dist/* _site/docs/
- uses: actions/upload-pages-artifact@v4
with:
path: _site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4