name: Documentation
on:
workflow_dispatch:
push:
branches:
- master
jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@efcb852328a9f50117170cc43094fb6f09eaf1ae
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
- name: Build documentation
run: cargo doc --verbose --no-deps --all-features
- name: Finalize documentation
run: |
CRATE_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]' | cut -f2 -d"/")
echo "<meta http-equiv=\"refresh\" content=\"0; url=${CRATE_NAME/-/_}\">" > target/doc/index.html
touch target/doc/.nojekyll
- name: Upload as artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with:
name: Documentation
path: target/doc