2019-12-30 08:55:40 +03:00
|
|
|
name: pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-10-02 15:26:22 +03:00
|
|
|
- main
|
2021-02-07 20:59:10 +03:00
|
|
|
paths:
|
2021-10-02 15:26:22 +03:00
|
|
|
- "docs/**"
|
|
|
|
- "ci/build-docs.sh"
|
|
|
|
- "ci/generate-docs.py"
|
|
|
|
- "ci/subst-release-info.py"
|
|
|
|
- ".github/workflows/pages.yml"
|
|
|
|
- ".github/ISSUE_TEMPLATE/*"
|
2019-12-30 09:22:14 +03:00
|
|
|
schedule:
|
|
|
|
- cron: "50 * * * *"
|
|
|
|
|
2019-12-30 08:55:40 +03:00
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-01-24 04:12:24 +03:00
|
|
|
uses: actions/checkout@v2.4.0
|
2019-12-30 08:55:40 +03:00
|
|
|
- name: Install Rust
|
|
|
|
run: |
|
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
|
|
|
|
source $HOME/.cargo/env
|
|
|
|
rustup update stable
|
2019-12-30 09:35:13 +03:00
|
|
|
- name: Cache mdBook
|
2019-12-30 08:55:40 +03:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2019-12-31 02:12:51 +03:00
|
|
|
path: ~/mdbook-bin
|
2022-04-04 08:09:17 +03:00
|
|
|
key: cargo-bin-mdbook-2
|
2019-12-30 08:55:40 +03:00
|
|
|
- name: Install mdBook
|
|
|
|
run: |
|
2019-12-31 02:12:51 +03:00
|
|
|
mkdir -p ~/mdbook-bin
|
2021-01-31 01:14:29 +03:00
|
|
|
(test -x ~/mdbook-bin/mdbook || (cd && cargo install --vers "^0.4" mdbook && cp -p ~/.cargo/bin/mdbook ~/mdbook-bin))
|
2021-02-24 20:27:13 +03:00
|
|
|
(test -x ~/mdbook-bin/mdbook-linkcheck || (cd && cargo install mdbook-linkcheck && cp -p ~/.cargo/bin/mdbook-linkcheck ~/mdbook-bin))
|
2022-04-04 08:09:17 +03:00
|
|
|
(test -x ~/mdbook-bin/mdbook-mermaid || (cd && cargo install mdbook-mermaid && cp -p ~/.cargo/bin/mdbook-mermaid ~/mdbook-bin))
|
2019-12-30 08:55:40 +03:00
|
|
|
- name: Build
|
2019-12-30 09:37:06 +03:00
|
|
|
run: |
|
|
|
|
source $HOME/.cargo/env
|
2020-05-04 02:28:12 +03:00
|
|
|
PATH="$HOME/mdbook-bin:$PATH"
|
|
|
|
./ci/build-docs.sh
|
2019-12-30 08:55:40 +03:00
|
|
|
- name: Deploy
|
2021-12-12 09:33:46 +03:00
|
|
|
if: success()
|
2020-12-10 01:11:42 +03:00
|
|
|
uses: crazy-max/ghaction-github-pages@v2
|
2019-12-30 08:55:40 +03:00
|
|
|
with:
|
|
|
|
target_branch: gh-pages
|
2021-02-24 20:27:13 +03:00
|
|
|
build_dir: gh_pages/html
|
2020-12-10 09:47:57 +03:00
|
|
|
keep_history: true
|
|
|
|
allow_empty_commit: false
|
2019-12-30 08:55:40 +03:00
|
|
|
env:
|
2020-12-10 02:58:14 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|