2020-02-13 00:55:45 -06:00
|
|
|
name: Book
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'docs/book/**'
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'docs/book/**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Test code examples
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Test via skeptic
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --manifest-path docs/book/tests/Cargo.toml
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy book on gh-pages
|
|
|
|
needs: [tests]
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install mdBook
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
|
|
|
|
- name: Render book
|
|
|
|
run: |
|
|
|
|
mdbook build -d gh-pages/master docs/book
|
|
|
|
|
|
|
|
- name: Deploy
|
2021-07-06 19:05:03 -05:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
2020-02-13 00:55:45 -06:00
|
|
|
with:
|
2021-07-06 19:05:03 -05:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2020-02-13 00:55:45 -06:00
|
|
|
keepFiles: true
|
2021-07-06 19:05:03 -05:00
|
|
|
publish_dir: docs/book/gh-pages
|