Skip to content

Add permissions to release ci (#17) #13

Add permissions to release ci (#17)

Add permissions to release ci (#17) #13

Workflow file for this run

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
jobs:
docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
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: Build Rustdoc
run: cargo +nightly -Zgitoxide -Zgit doc --all --no-deps --lib
env:
RUSTDOCFLAGS: "-Z unstable-options --enable-index-page"
- name: Build User Guide
run: |
cargo install --vers "^0.4" mdbook
mdbook build docs && mdbook test docs
mv docs/book target/doc
- name: Deploy Docs
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: target/doc
dry-run: ${{ github.event_name == 'pull_request' }}