mpvrc/.github/workflows/doc.yml
2025-06-11 13:02:24 +03:00

67 lines
1.4 KiB
YAML

name: Documentation
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: deploy
cancel-in-progress: false
jobs:
rustdoc:
name: Build API docs
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Setup pages
id: pages
uses: actions/configure-pages@v5
- name: Build Documentation
run: |
cargo clean --doc ; cargo doc --no-deps --workspace --all-features
- name: Add redirect
run: echo '<meta http-equiv="refresh" content="0;url=mrc/index.html">' > target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy Documentation
runs-on: ubuntu-latest
needs: rustdoc
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4