-
Notifications
You must be signed in to change notification settings - Fork 105
44 lines (40 loc) · 1.14 KB
/
mdbook.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
name: Book Publish
#v
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
changed:
- 'book/**'
- '.github/workflows/mdbook.yml'
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
if: ${{ steps.changes.outputs.changed == 'true' || startsWith(github.ref, 'refs/tags/') }}
with:
mdbook-version: '0.4.10'
# mdbook-version: 'latest'
- name: mdbook build
if: ${{ steps.changes.outputs.changed == 'true' || startsWith(github.ref, 'refs/tags/') }}
run: |
cd book
mdbook build
cd -
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ steps.changes.outputs.changed == 'true' || startsWith(github.ref, 'refs/tags/') }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book