Skip to content

Commit

Permalink
Added a build script for GitHub Actions; deleted broken plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nakov committed Jul 8, 2021
1 parent 24b047c commit e6d0769
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/gitbook-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Gitbook Build & Deploy to gh-pages

on: [workflow_dispatch]

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
1 change: 0 additions & 1 deletion book.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"anchors",
"expandable-chapters-small",
"katex",
"sitemap",
"scripts"
],
"pluginsConfig": {
Expand Down

0 comments on commit e6d0769

Please sign in to comment.