name: Documentation
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
docs:
permissions:
contents: write
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --no-deps
- name: Finalize documentation
run: |
touch target/doc/.nojekyll
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
- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
name: Documentation
path: target/doc
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/doc