-
Notifications
You must be signed in to change notification settings - Fork 159
72 lines (59 loc) · 2.06 KB
/
Copy pathdeploy-cookbook.yml
File metadata and controls
72 lines (59 loc) · 2.06 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
name: Deploy cookbook to GitHub Pages
on:
push:
branches: [master]
workflow_dispatch:
# Permissions required by actions/deploy-pages
permissions:
contents: read
pages: write
id-token: write
# Serialize deployments so a new push waits for the current deployment to
# finish before starting. Do NOT cancel in-progress runs as we want to let
# production deployments complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
# Build gl-react packages (cookbook imports from src via Vite alias,
# but mirrors the existing CI pipeline for consistency).
- name: Build gl-react packages
run: |
for d in packages/gl-react packages/gl-react-dom; do
pnpm exec babel --root-mode upward --source-maps --extensions '.ts,.tsx' -d "$d/lib" "$d/src"
done
# Run Vite build directly (bypassing the package's "tsc && vite build"
# script which currently has unresolved TS errors unrelated to deploy).
# The Vite dev server is the source of truth for cookbook today.
- name: Build cookbook
env:
GH_PAGES: "true"
working-directory: packages/cookbook
run: pnpm exec vite build
# SPA fallback: GitHub Pages serves 404.html on unknown paths. Copying
# index.html → 404.html lets BrowserRouter handle deep links / refreshes.
- name: SPA fallback (404.html)
run: cp packages/cookbook/dist/index.html packages/cookbook/dist/404.html
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: packages/cookbook/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4