-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (62 loc) · 1.75 KB
/
github_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
name: github pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: enable corepack before setting up node
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Check and install mdbook if not already installed
run: |
if ! command -v mdbook &> /dev/null; then
cargo install mdbook
fi
- name: Check and install mdbook-admonish if not already installed
run: |
if ! command -v mdbook-admonish &> /dev/null; then
cargo install mdbook-admonish
fi
- name: Check and install mdbook-mermaid if not already installed
run: |
if ! command -v mdbook-mermaid &> /dev/null; then
cargo install mdbook-mermaid
fi
- name: build book
run: make build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4