-
Notifications
You must be signed in to change notification settings - Fork 132
48 lines (42 loc) · 1.21 KB
/
docs.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
name: Build and publish docs
on:
push:
branches:
- master
paths:
- 'book.toml'
- 'doc/**'
- '!doc/api/**.yaml'
pull_request:
paths:
- 'book.toml'
- 'doc/**'
- '!doc/api/**.yaml'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install linkcheck
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir $GITHUB_WORKSPACE/mdbook-linkcheck
cd $GITHUB_WORKSPACE/mdbook-linkcheck
gh release --repo Michael-F-Bryan/mdbook-linkcheck download --pattern '*x86_64-unknown-linux-gnu.zip'
unzip *x86_64-unknown-linux-gnu.zip
rm *x86_64-unknown-linux-gnu.zip
chmod +x ./mdbook-linkcheck
echo $GITHUB_WORKSPACE/mdbook-linkcheck >> $GITHUB_PATH
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- name: Build
run: mdbook build
- name: Deploy
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/html