name: Docs
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build rustdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: rustup show
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install native audio dependencies
timeout-minutes: 15
run: python3 .github/scripts/apt_install.py libasound2-dev
- name: Build API documentation
run: cargo doc --workspace --no-deps --features native
env:
RUSTDOCFLAGS: -D warnings
- name: Add redirect index
run: echo '<meta http-equiv="refresh" content="0; url=zvidlib/index.html">' > target/doc/index.html
- uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4