-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 1.87 KB
/
Copy pathdocs.yml
File metadata and controls
74 lines (63 loc) · 1.87 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
name: Docs
# Build runs on every push / PR that touches docs.
# Deploy is gated by `vars.PAGES_ENABLED` (set this repo variable to "true"
# in Settings -> Secrets and variables -> Actions -> Variables once Pages is
# enabled - Pages on private repos requires GitHub Pro/Team).
on:
push:
branches: ["main"]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
pull_request:
paths:
- "docs/**"
workflow_dispatch:
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build engine packages
run: |
pnpm --filter @ctok/core build
pnpm --filter @ctok/scanner build
pnpm --filter @ctok/refiner build
pnpm --filter @ctok/quota build
- name: Build docs
run: pnpm --filter @ctok/docs build
- name: Build web playground
env:
BASE_PATH: /ctok/playground
run: pnpm --filter @ctok/web build
- name: Stitch playground into docs site
run: |
mkdir -p docs/dist/playground
cp -r packages/web/out/. docs/dist/playground/
- name: Upload artifact
if: vars.PAGES_ENABLED == 'true' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/dist/
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
if: vars.PAGES_ENABLED == 'true' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy
id: deploy
uses: actions/deploy-pages@v4