-
Notifications
You must be signed in to change notification settings - Fork 54
40 lines (39 loc) · 1.18 KB
/
docs.yaml
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
name: Docs
on:
# release:
# types: [created]
push:
branches:
- master
jobs:
build_book:
name: Build user docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install mdbook
env:
VERSION: v0.3.7
run: |
wget "https://github.com/rust-lang/mdBook/releases/download/${VERSION}/mdbook-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" -O 'mdbook.tar.gz'
tar xvzf mdbook.tar.gz
rm mdbook.tar.gz
./mdbook --version
- name: Build book
run: |
cd docs
../mdbook build
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export COMMIT_HASH="$(echo "${GITHUB_SHA}" | cut -c1-7)"
cd docs/book
git config --global user.email ''
git config --global user.name 'GitHub Actions'
git init
git remote add origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}"
git add --all
git commit -m "Generated docs for ${COMMIT_HASH}"
git push -uf origin master:gh-pages