name: docs
on:
push:
branches: [main]
pull_request:
permissions: {}
jobs:
docs:
name: docs
runs-on: ubuntu-latest
permissions: { contents: write }
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
with:
toolchain: nightly
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
- name: Build docs
run: cargo doc --no-deps -Zrustdoc-map
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs"
- name: Deploy docs
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc/
force_orphan: true