-
Notifications
You must be signed in to change notification settings - Fork 9
121 lines (103 loc) 路 3.48 KB
/
Copy pathdocs.yml
File metadata and controls
121 lines (103 loc) 路 3.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy Docs
on:
pull_request:
branches:
- main
paths:
- 'docs/**'
- 'src/docs_gen/**'
- 'src/rest/**'
- 'src/auth/**'
- 'src/taxonomy/taxonomy.toml'
- 'src/templates/*.json'
- 'src/collections/**'
- 'collections/**'
- 'src/schemas/**'
# The shared components bundle ships with the site, and the workflow
# exporter's ordering rule is mirrored by the graph mapper.
- 'webcomponents/**'
- 'src/workflow_gen/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
BUNDLE_FROZEN: 'true'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
# Install Rust toolchain for docs generation
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.95
# Cache cargo for faster builds
- name: Cache cargo
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-docs-
# The components are typed against these; generate before they compile.
- name: Generate TypeScript bindings
run: cargo test --locked export_bindings_
# Shared components, built before Jekyll so the site never needs a
# prebuilt bundle committed to the repo.
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Build shared web components
working-directory: webcomponents
run: |
bun install --frozen-lockfile
bun run typecheck
bun test
bun run build
# Generate reference documentation from source-of-truth files. After the
# components so the pipeline matches `make docs` (bindings ->
# webcomponents -> generated docs -> Jekyll).
- name: Generate reference docs
run: cargo run --locked -- docs
- name: Stage web components into the site
run: |
mkdir -p docs/assets/js
cp webcomponents/dist/elements.js webcomponents/dist/elements.css docs/assets/js/
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: docs
- name: Audit gems
run: gem install bundler-audit && bundle-audit check --update
working-directory: docs
- name: Build Jekyll site
run: bundle exec jekyll build
working-directory: docs
# The hosted collection bundle is excluded from Jekyll processing (see
# docs/_config.yml) and copied in verbatim, so every file operator fetches
# matches the SHA-256 recorded in its manifest.
- name: Stage the collection bundle verbatim
run: cp -R docs/collections docs/_site/
- name: Verify the served bundle is byte-identical
run: |
diff -r docs/collections docs/_site/collections
- name: Deploy to gh-pages
if: github.event_name == 'workflow_dispatch'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site
publish_branch: gh-pages
force_orphan: true