-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (61 loc) · 1.79 KB
/
docs.yml
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
name: Docs
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
concurrency:
group: rustdoc-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_TOOLCHAIN: nightly-2024-08-01 # Define the toolchain date here
jobs:
docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: wasm32-unknown-unknown
components: rust-src
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install mdbook and mdbook-mermaid
run: |
cargo install mdbook --version 0.4.40
cargo install mdbook-mermaid --version 0.14.0
- name: Build Rustdoc
run: cargo +${{ env.RUST_TOOLCHAIN }} -Zgitoxide -Zgit doc --all --no-deps --lib
env:
RUSTDOCFLAGS: "-Z unstable-options --enable-index-page"
- name: Build Book
run: |
mdbook build docs && mdbook test docs
mv docs/book target/doc
- name: Deploy Docs (Rustdoc and Book)
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: target/doc
dry-run: ${{ github.event_name == 'pull_request' }}