-
-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (39 loc) · 1.72 KB
/
build.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
name: Mdbook build
on:
push:
branches: ["main"]
jobs:
build:
name: build
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: "0.4.22"
MDBOOK_LINKCHECK_VERSION: "0.7.4"
MDBOOK_MERMAID_VERSION: "0.12.2"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install mdbook
run: |
mkdir ~/tools
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 ~/tools
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 ~/tools
curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VERSION/mdbook-linkcheck.v$MDBOOK_LINKCHECK_VERSION.x86_64-unknown-linux-gnu.zip -O
curl -L https://github.com/gist-rs/mdbook-svgbob/releases/download/v0.3.0/mdbook-svgbob_v0.3.0_x86_64-unknown-linux-musl.tar.gz | tar xz -C ~/tools
unzip mdbook-linkcheck.v$MDBOOK_LINKCHECK_VERSION.x86_64-unknown-linux-gnu.zip -d ~/tools
chmod +x ~/tools/mdbook-linkcheck
curl -s https://api.github.com/repos/zjp-CN/mdbook-theme/releases/latest \
| grep browser_download_url \
| grep mdbook-theme_linux \
| cut -d '"' -f 4 \
| wget -qi -
tar -xzf mdbook-theme_linux.tar.gz -C ~/tools
echo ~/tools >> $GITHUB_PATH
- name: Build
run: mdbook build
# share between different jobs
- uses: actions/upload-artifact@v3
with:
name: book
path: book/