91 lines
2.5 KiB
YAML
91 lines
2.5 KiB
YAML
name: pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "docs/**"
|
|
- "ci/build-docs.sh"
|
|
- "ci/generate-docs.py"
|
|
- "ci/subst-release-info.py"
|
|
- ".github/workflows/pages.yml"
|
|
- ".github/ISSUE_TEMPLATE/*"
|
|
schedule:
|
|
- cron: "50 * * * *"
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: "Install Rust"
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: "minimal"
|
|
toolchain: "stable"
|
|
default: true
|
|
override: true
|
|
components: "rustfmt"
|
|
env:
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
|
|
- uses: actions/cache@v3
|
|
name: Cache mdbook
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-mdbook-${{ hashFiles('.github/workflows/pages.yml') }}
|
|
- name: Install mdBook
|
|
run: |
|
|
(test -x ~/.cargo/bin/mdbook || (cd && cargo install mdbook --no-default-features --features search --vers "^0.4" --locked))
|
|
- name: Install mdBook linkcheck
|
|
run: |
|
|
(test -x ~/.cargo/bin/mdbook-linkcheck || (cd && cargo install mdbook-linkcheck --locked))
|
|
- name: Install mdBook mermaid
|
|
run: |
|
|
(test -x ~/.cargo/bin/mdbook-mermaid || (cd && cargo install mdbook-mermaid --locked))
|
|
- name: Install mdBook admonish
|
|
run: |
|
|
(test -x ~/.cargo/bin/mdbook-admonish || (cd && cargo install mdbook-admonish --locked))
|
|
- name: Install gelatyx
|
|
run: |
|
|
(test -x ~/.cargo/bin/gelatyx || (cd && cargo install gelatyx --version "^0.2" --locked))
|
|
- name: Build
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
source $HOME/.cargo/env
|
|
./ci/build-docs.sh
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: gh_pages/html
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1
|