Skip to content

Commit 01d2ec7

Browse files
authored
Added build script
1 parent 60d9352 commit 01d2ec7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/gitbook-deploy.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Gitbook Build & Deploy to gh-pages
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
build-and-publish:
7+
name: Build and Deploy Gitbook
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout the source code from GitHub
11+
uses: actions/checkout@v2
12+
with: { fetch-depth: 0 }
13+
- name: Install Node.js (version 10, not higher!)
14+
uses: actions/setup-node@v2
15+
with: { node-version: '10' }
16+
- name: Install Gitbook CLI client (gitbook-cli)
17+
run: npm install -g gitbook-cli
18+
- name: Install Gitbook plugins (git install)
19+
run: gitbook install
20+
- name: Build the book to the `_book` folder (git build)
21+
run: gitbook build . --log=debug --debug
22+
- name: Checkout the `gh-pages` branch into the `_gh-pages` folder
23+
run: git worktree add ./_gh-pages gh-pages
24+
- name: Copy the compiled book files to `_gh-pages`
25+
run: cp -R ./_book/* ./_gh-pages
26+
- name: Commit and push the changed book files in the `gh-pages` branch
27+
run: |
28+
cd _gh-pages
29+
git add .
30+
git status
31+
git config --local user.name "github-actions-gitbook-bot"
32+
git config --local user.email "[email protected]"
33+
git commit -m "Book web site deployment"
34+
git push

0 commit comments

Comments
 (0)