-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (64 loc) · 1.91 KB
/
pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Pages
on: [push, pull_request]
jobs:
mdbook:
name: mdBook
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install Rust
run: |
rm --recursive --force "${HOME}/.cargo" "${HOME}/.rustup"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "${HOME}/.cargo/env"
echo "RUSTC_VERSION=$(rustc --version | grep --only-matching '[0-9]\+\.[0-9]\+\.[0-9]\+' | head --lines=1)" >> $GITHUB_ENV
- name: Install Graphviz
run: |
sudo apt update || true
sudo apt --yes --no-install-recommends install graphviz
- name: Cache mdBook
id: cache
uses: actions/cache@v3
# Environment variables do not seem to work, use ~ instead.
with:
path: |
~/.cargo
key: ubuntu-22.04-rustc-${{ env.RUSTC_VERSION }}-mdbook
- name: Install mdBook
run: |
# Fix for incompatability of mdbook graphviz with newest mdbook
cargo install --locked [email protected] mdbook-graphviz
- name: Configure Pages
uses: actions/configure-pages@v2
- name: Build book
run: |
cd docs
mdbook build
- name: Upload book
uses: actions/upload-pages-artifact@v1
with:
path: docs/book
deploy:
name: Deploy
needs: mdbook
runs-on: ubuntu-22.04
timeout-minutes: 30
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@v1