-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (67 loc) · 3.02 KB
/
Copy pathdocs.yml
File metadata and controls
72 lines (67 loc) · 3.02 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: API Docs
# Builds the TypeDoc API reference and deploys it to GitHub Pages.
# One-time setup: repo Settings -> Pages -> Build and deployment -> Source: "GitHub Actions".
# The gitignored internal/scripts/gen-api-docs.mjs is NOT used here (CI has no internal/);
# typedoc runs directly against the tracked typedoc.json, with the version name read from core.
on:
push:
# Deploy only from develop: it's the default branch the github-pages env allows, and it's
# fast-forwarded to main after every release, so the docs still track the released code.
branches: [develop]
paths:
- 'packages/*/src/**'
- 'typedoc.json'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# One deploy at a time; let an in-flight deploy finish rather than cancelling it.
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter './packages/*' build
- name: Generate API reference (version read live from @asksql/core)
run: |
VERSION=$(node -p "require('./packages/core/package.json').version")
npx typedoc --name "AskSQL API Reference (core v$VERSION)"
# The extension's store listings need a live privacy-policy URL; publish
# PRIVACY.md on the same Pages site at /privacy.html.
- name: Render privacy policy page
run: |
# Pinned: this job holds pages:write, so an unpinned npx runs arbitrary registry code.
npx --yes marked@18.0.9 --gfm -i packages/browser-extension/PRIVACY.md > /tmp/privacy-body.html
{
echo '<!doctype html><html lang="en"><head><meta charset="utf-8">'
echo '<meta name="viewport" content="width=device-width,initial-scale=1">'
echo '<title>AskSQL Privacy Policy</title>'
echo '<style>body{max-width:760px;margin:2rem auto;padding:0 1rem;font:16px/1.6 system-ui;color:#222}code{background:#f4f4f4;padding:1px 4px;border-radius:3px}table{border-collapse:collapse}td,th{border:1px solid #ccc;padding:4px 8px}</style>'
echo '</head><body>'
cat /tmp/privacy-body.html
echo '</body></html>'
} > docs/api/privacy.html
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: docs/api
# typedoc emits .nojekyll, and v4 onwards drops dotfiles unless asked. Actions-based
# Pages serves the artifact verbatim so nothing here runs Jekyll, but keeping the file
# means the same output also works if this ever moves to branch-based Pages.
include-hidden-files: true
- id: deployment
uses: actions/deploy-pages@v5