-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (73 loc) · 2.53 KB
/
Copy pathdocs-deploy.yml
File metadata and controls
78 lines (73 loc) · 2.53 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
name: Deploy docs
# Publishes the Starlight docs site to GitHub Pages on every push to main that
# touches the docs source, the suite's Go source (so the regenerated API
# reference and Mermaid diagrams stay current), the generator itself, or this
# workflow. Every module whose godoc feeds the generated Reference section is
# listed so a godoc change in any of them redeploys the site, not just state.
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'tools/docsgen/**'
- 'state/**'
- 'sink/**'
- 'source/**'
- 'telemetry/**'
- 'durable/**'
- 'cluster/**'
- 'transport/**'
- 'wasm/**'
- '.github/workflows/docs-deploy.yml'
# Least-privilege: read the repo, mint an OIDC token for Pages, write the
# Pages deployment. No other scopes.
permissions:
contents: read
pages: write
id-token: write
# Serialize Pages deployments. Do NOT cancel in progress: a half-applied Pages
# deploy can leave the live site inconsistent, so let each one finish.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26.4"
cache-dependency-path: "**/go.sum"
# Regenerate derived docs content before the site build so the published
# API reference (gomarkdoc) and Mermaid diagram partials stay current with
# the suite's Go source. Runs from the repo root, not the docs/ default dir.
- name: Generate API reference + diagrams
working-directory: .
run: go run ./tools/docsgen
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0