60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: Pages
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
pages:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
RUSTFLAGS: --deny warnings
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Rust Toolchain Components
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: 1.56.0
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Install `mdbook`
|
|
uses: peaceiris/actions-mdbook@v1
|
|
with:
|
|
mdbook-version: latest
|
|
|
|
- name: Install `mdbook-linkcheck`
|
|
run: |
|
|
mkdir -p mdbook-linkcheck
|
|
cd mdbook-linkcheck
|
|
wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
|
|
unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
|
|
chmod +x mdbook-linkcheck
|
|
pwd >> $GITHUB_PATH
|
|
|
|
- name: Build book
|
|
run: |
|
|
cargo run --package generate-book
|
|
mdbook build book/en
|
|
mdbook build book/zh
|
|
|
|
- name: Deploy Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
if: github.ref == 'refs/heads/master'
|
|
with:
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
publish_branch: gh-pages
|
|
publish_dir: www
|