-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (56 loc) · 2.48 KB
/
docs.yml
File metadata and controls
67 lines (56 loc) · 2.48 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
# ┌─────────────────────────────────────────────────────────────────────┐
# │ Generate API docs from source and push them to the semos │
# │ website repo via repository_dispatch. │
# │ │
# │ Requirements: │
# │ - A repo secret SEMOS_DOCS_TOKEN (a GitHub PAT with repo scope │
# │ that can dispatch events to semos-labs/semos) │
# │ - typedoc + typedoc-plugin-markdown as dev dependencies │
# │ - A typedoc.json config in the repo root │
# └─────────────────────────────────────────────────────────────────────┘
name: Push Docs to Website
on:
release:
types: [published]
workflow_dispatch:
jobs:
generate-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Generate docs with TypeDoc
run: bunx typedoc
- name: Post-process for Starlight
run: bun scripts/postprocess-docs.ts .docs-out
- name: Package docs
run: tar -czf docs.tar.gz -C .docs-out .
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: glyph-docs
path: docs.tar.gz
retention-days: 3
- name: Notify website repo
uses: actions/github-script@v7
env:
PRODUCT_NAME: glyph
with:
github-token: ${{ secrets.SEMOS_DOCS_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'semos-labs',
repo: 'semos',
event_type: 'docs-update',
client_payload: {
product: process.env.PRODUCT_NAME,
run_id: String(context.runId),
repository: `${context.repo.owner}/${context.repo.repo}`,
sha: context.sha,
},
});
console.log(`Dispatched docs-update to semos-labs/semos (run ${context.runId})`);