-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (43 loc) · 1.68 KB
/
Copy pathdocs.yml
File metadata and controls
53 lines (43 loc) · 1.68 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
name: docs
# Build the @mermaid-lint/core API reference (typedoc) and deploy the static
# HTML to Cloudflare Pages at https://docs.mermaidlint.com.
#
# One-time setup (Cloudflare dashboard + repo secrets) is documented in
# docs/cloudflare-docs-setup.md. The apex mermaidlint.com redirect is handled
# separately by the mermaidlint-redirect Worker and is unrelated to this job.
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
# Allow one concurrent deployment; let an in-flight run finish.
concurrency:
group: cloudflare-pages-docs
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# pnpm version comes from the "packageManager" field in package.json.
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: '24'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build core
run: pnpm --filter @mermaid-lint/core build
# Generate the API reference, then block the deploy if the output has a
# Cloudflare Pages reserved path (e.g. a top-level functions/ dir).
- name: Generate API docs (typedoc) + Cloudflare Pages safety check
run: |
pnpm --filter @mermaid-lint/core docs
node scripts/check-docs-cloudflare-safe.mjs packages/core/docs
- name: Deploy to Cloudflare Pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: pnpm dlx wrangler@4.99.0 pages deploy packages/core/docs --project-name mermaid-lint-docs --branch main