Skip to content

ci(docs): add GitHub Actions workflow for building and deploying docs #4

ci(docs): add GitHub Actions workflow for building and deploying docs

ci(docs): add GitHub Actions workflow for building and deploying docs #4

Workflow file for this run

name: Docs
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build docs
run: cargo doc --no-deps
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4