Deploy docs #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# keep the workflow only for manual deployment because of Github monthly CI quota | |
on: | |
workflow_dispatch: | |
name: Deploy docs | |
jobs: | |
deploy-docs: | |
name: Deploy docs on gh-pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Rust setup (nightly) | |
uses: dtolnay/rust-toolchain@master | |
with: | |
# Use nightly to build the docs with `--cfg docsrs` | |
toolchain: nightly | |
components: rust-docs | |
- name: Build docs | |
# Building locally: | |
# for `--enable-index-page` it is required to pass `-Z unstable-options` to rustdocs | |
run: RUSTDOCFLAGS="--cfg docsrs -Z unstable-options --enable-index-page" cargo +nightly doc --all-features --no-deps --workspace | |
- name: Prepare /docs | |
run: | | |
rm -rf ./docs | |
mv target/doc ./docs | |
- name: Deploy gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs |