Skip to content

Commit bffbf66

Browse files
committed
Add book deploy in CI.
1 parent 61dc06c commit bffbf66

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
doc:
10+
name: Documentation
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install mdbook
15+
run: |
16+
mkdir mdbook
17+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.1/mdbook-v0.4.1-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
18+
echo ::add-path::`pwd`/mdbook
19+
- name: Build book
20+
run: cd doc && mdbook build
21+
- name: Deploy to GitHub
22+
run: |
23+
cd doc/book
24+
git init
25+
git config user.name "Deploy from CI"
26+
git config user.email ""
27+
git add . .nojekyll
28+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
29+
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
30+
git push --force --set-upstream origin master:gh-pages

0 commit comments

Comments
 (0)