-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (80 loc) · 2.46 KB
/
Copy pathdocs.yml
File metadata and controls
94 lines (80 loc) · 2.46 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
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "widget/**"
- ".github/workflows/docs.yml"
pull_request:
branches: [main]
paths:
- "docs/**"
- "widget/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Docs
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The hosted API reference is generated from the widget's TSDoc and copied
# into docs/public/api by the docs build (scripts/copy-api.mjs). Generate
# it here first so it ships with this deploy.
- name: Install widget dependencies
working-directory: widget
run: pnpm install --frozen-lockfile
- name: Generate API reference (TypeDoc)
working-directory: widget
run: pnpm docs:api
- name: Build (includes Pagefind index)
run: pnpm build
- uses: actions/upload-artifact@v4
with:
name: docs-dist
path: docs/dist
deploy:
name: Deploy to Cloudflare Pages
# Deploys need the CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repo
# secrets, and a one-time `wrangler pages project create claudius-docs`.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
# wrangler-action installs wrangler with the package manager it detects
# from docs/pnpm-lock.yaml, so pnpm must be on PATH in this job too.
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/download-artifact@v4
with:
name: docs-dist
path: docs/dist
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: docs
command: pages deploy dist --project-name=claudius-docs