-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 3.4 KB
/
Copy pathdocs.yml
File metadata and controls
86 lines (80 loc) · 3.4 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
name: Docs
# Build the mdBook documentation site from docs/ (guides) + theme/ (shared
# ProcessKit-family look) and publish successful main-branch builds to GitHub
# Pages. Every push and PR that touches the docs rebuilds the book as a gate; only
# a push to main deploys it.
#
# GENERATOR: mdBook, pinned to v0.4.40 — the same version the sibling
# ProcessKit-rs / ProcessKit-fSharp docs workflows use, so all three books render
# identically. theme/nav-links.js relies on that version's draft-chapter DOM
# (`<li class="chapter-item ... affix "><div>Title</div></li>`); do not bump the
# pin without re-verifying the sidebar switcher.
#
# The API reference (docs/api-reference.md) is committed as static Markdown,
# generated from the type stub by scripts/gen_api_reference.py and kept fresh by
# the drift guard in tests/test_api_reference.py — so this build needs no Python
# toolchain, only mdBook.
on:
push:
branches: [main]
paths: ['docs/**', 'theme/**', CHANGELOG.md, book.toml, justfile, scripts/check_docs_links.py, scripts/gen_changelog_page.py, .github/workflows/docs.yml]
pull_request:
branches: [main]
paths: ['docs/**', 'theme/**', CHANGELOG.md, book.toml, justfile, scripts/check_docs_links.py, scripts/gen_changelog_page.py, .github/workflows/docs.yml]
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
# Build gate: runs on every PR, push, and manual dispatch. A SUMMARY.md entry
# pointing at a missing chapter fails the build, so a renamed/removed guide
# can't ship a broken book.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install mdBook
run: |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz \
| tar -xz -C /usr/local/bin
- name: Build the book
run: mdbook build
- name: Check generated release notes
run: python scripts/gen_changelog_page.py --check
- name: Check rendered local links and anchors
run: python scripts/check_docs_links.py book
deploy:
# PRs validate the book only; only a push to main may publish it.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install mdBook
run: |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz \
| tar -xz -C /usr/local/bin
- name: Build the book
run: mdbook build
- name: Check generated release notes
run: python scripts/gen_changelog_page.py --check
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: book
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0