Introduce subcoin snapcake #280
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }} |