name: Deploy Documentation to GitHub Pages
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build documentation site
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 with:
toolchain: stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 - run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
- name: Generate documentation
env:
GIT_EDITOR_NO_BROWSER: "1"
run: |
mkdir -p docs-site
cargo run --release --locked -- --docs --docs-out docs-site/index.html
printf 'User-agent: *\nAllow: /\n' > docs-site/robots.txt
touch docs-site/.nojekyll
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa with:
path: ./docs-site
deploy:
name: Deploy to GitHub Pages
needs: build
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e