-
-
Notifications
You must be signed in to change notification settings - Fork 79
35 lines (33 loc) · 1.08 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
name: Book
on:
push:
branches:
- main
paths:
- 'docs/**'
workflow_dispatch:
jobs:
deploy_en:
name: Deploy book on gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Install mdBook
# uses: peaceiris/actions-mdbook@v1
- name: Render book
run: |
# From cloudflare pages
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz -o mdbook.tgz && tar xzvf mdbook.tgz && ./mdbook build docs/en && mkdir dist && mv -v docs/en/book/html dist/en && mv -v assets dist && mv -v docs/landing/index.html docs/landing/css docs/landing/js dist
mv docs/CNAME dist
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
allow_empty_commit: true
keep_files: false
publish_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: dist