-
Notifications
You must be signed in to change notification settings - Fork 173
37 lines (34 loc) · 1.31 KB
/
gitbook-deploy.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
name: Gitbook Build & Deploy to gh-pages
on: [workflow_dispatch]
permissions:
contents: write
jobs:
build-and-publish:
name: Build and Deploy Gitbook
runs-on: ubuntu-latest
steps:
- name: Checkout the source code from GitHub
uses: actions/checkout@v2
with: { fetch-depth: 0 }
- name: Install Node.js (version 10, not higher!)
uses: actions/setup-node@v2
with: { node-version: '10' }
- name: Install Gitbook CLI client (gitbook-cli)
run: npm install -g gitbook-cli
- name: Install Gitbook plugins (git install)
run: gitbook install
- name: Build the book to the `_book` folder (git build)
run: gitbook build . --log=debug --debug
- name: Checkout the `gh-pages` branch into the `_gh-pages` folder
run: git worktree add ./_gh-pages gh-pages
- name: Copy the compiled book files to `_gh-pages`
run: cp -R ./_book/* ./_gh-pages
- name: Commit and push the changed book files in the `gh-pages` branch
run: |
cd _gh-pages
git add .
git status
git config --local user.name "github-actions-gitbook-bot"
git config --local user.email "[email protected]"
git commit -m "Book web site deployment"
git push