-
Notifications
You must be signed in to change notification settings - Fork 155
58 lines (55 loc) · 1.76 KB
/
book.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
name: Book
on:
push:
branches:
- master
pull_request:
paths:
- "book/**"
- ".github/workflows/book.yml"
merge_group:
jobs:
book:
name: Book
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: "0.4.40"
MDBOOK_LINKCHECK_VERSION: "0.7.7"
MDBOOK_MERMAID_VERSION: "0.13.0"
steps:
- uses: actions/checkout@v4
- name: Install mdbook
run: |
curl -L https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
curl -L https://github.com/badboy/mdbook-mermaid/releases/download/v$MDBOOK_MERMAID_VERSION/mdbook-mermaid-v$MDBOOK_MERMAID_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VERSION/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip -O
unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip -d ~/.cargo/bin
chmod +x ~/.cargo/bin/mdbook-linkcheck
- name: Build
run: mdbook build
working-directory: book
- uses: actions/upload-artifact@v4
with:
name: book
path: book/book/html
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: book
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
concurrency:
group: github-pages
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: book
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: .
- uses: actions/deploy-pages@v4