-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (39 loc) · 984 Bytes
/
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
name: Book
on:
push:
branches:
- master
pull_request:
paths:
- 'book/**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install mdbook
run: |
mkdir -p $HOME/mdbook
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar xz -C $HOME/mdbook
echo "${HOME}/mdbook/" >> $GITHUB_PATH
- name: Build
run: mdbook build
working-directory: book
- uses: actions/upload-artifact@v2
with:
name: book
path: book/book
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [build]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v2
with:
name: book
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .