-
Notifications
You must be signed in to change notification settings - Fork 58
86 lines (81 loc) · 2.69 KB
/
Copy pathdocs.yml
File metadata and controls
86 lines (81 loc) · 2.69 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
# Builds the docs website (Next.js + Fumadocs, content from docs/) and
# deploys it to GitHub Pages.
#
# Requires Pages to be enabled for the repository with "GitHub Actions" as the
# source (Settings → Pages → Build and deployment → Source).
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "website/**"
- ".github/workflows/docs.yml"
# The /playground page ships the wasm runtime + browser SDK.
- "crates/chidori-wasm/**"
- "crates/chidori-js/**"
- "sdk/browser/**"
- "scripts/build-wasm.sh"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment, but don't cancel an in-flight production
# deploy — let it finish and deploy the newer build after.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: website/package-lock.json
# Build the /playground wasm assets (engine + browser SDK) into
# website/public/chidori-wasm before the site build. wasm-bindgen-cli
# must match the wasm-bindgen pin in crates/chidori-wasm/Cargo.toml.
#
# rust-toolchain.toml pins the channel, and cargo always builds with
# that pinned toolchain — so the wasm target has to be added to it,
# not to `stable` (dtolnay/rust-toolchain@stable used to do that, and
# the target landed on a toolchain the build never uses). Argument-less
# `rustup toolchain install` reads rust-toolchain.toml.
- name: Install pinned toolchain with wasm target
run: |
rustup toolchain install
rustup target add wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
key: docs-wasm
- uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen@0.2.126
- name: Build wasm playground assets
run: scripts/build-wasm.sh
- name: Install dependencies
run: npm ci
working-directory: website
- name: Build site
run: npm run build
working-directory: website
env:
# Project pages are served under /<repo>. Drop this (or set it to
# empty) if the site moves to a custom domain.
DOCS_BASE_PATH: /chidori
- uses: actions/upload-pages-artifact@v3
with:
path: website/out
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4