-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (42 loc) · 1.13 KB
/
book.yml
File metadata and controls
51 lines (42 loc) · 1.13 KB
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
name: Build book
on:
push:
branches-ignore:
- gh-pages
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install mdbook
run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=$HOME/.cargo/bin
- name: Checkout source
uses: actions/checkout@v4
- name: Build book
run: mdbook build
- name: Upload book artifact
uses: actions/upload-artifact@v4
with:
name: book
path: book
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download book artifact
uses: actions/download-artifact@v4
with:
name: book
path: public
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}