Skip to content

Documentation

Documentation #411

Workflow file for this run

---
name: Documentation
"on":
push:
branches:
- trunk
pull_request:
branches:
- trunk
schedule:
- cron: "0 0 * * TUE"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
permissions: {}
jobs:
rustdoc:
name: Build Rust API docs
runs-on: ubuntu-latest
permissions:
contents: write # required to push docs to github-pages branch
env:
RUSTDOCFLAGS: -D warnings -D rustdoc::broken_intra_doc_links --cfg docsrs
RUST_BACKTRACE: 1
steps:
# https://github.com/actions/checkout/issues/135
- name: Setup git line ending checkout behavior
shell: bash
if: runner.os == 'Windows'
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
- name: Check docs with no default features
run: cargo doc --workspace --no-default-features
- name: Clean docs
run: cargo clean
- name: Build Documentation
run: cargo doc --workspace
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
if: github.ref == 'refs/heads/trunk'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_branch: gh-pages
user_name: artichoke-ci
user_email: ci@artichokeruby.org
# only have the most recent docs in the `gh-pages` branch
# https://github.com/artichoke/artichoke/issues/1826
force_orphan: true