-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (42 loc) · 1.15 KB
/
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
43
name: Deploy Book
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository == 'future-proof-iot/RIOT-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build docs
run: |
cd book
mdbook build
- name: Update gh-pages branch
# This has no reason to fail, only the commit step fails if there are no
# changes.
continue-on-error: true
run: |
cd book
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
git rm -rf dev
mv ../book dev
git add dev
git commit -m "Deploy $GITHUB_SHA to gh-pages"
- name: Deploy changed book
# only deploy if there were changes
if: success()
run: |
cd book/gh-pages
git push --force