STEP1 Add Action
Add .github/workflows/gitbook-action.yml
in your repo, with following content.
name: 'Gitbook Action Build'
on:
push:
branches:
- master # trigger branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v2
- name: Gitbook Action
uses: zanderzhao/gitbook-action@v1.2.4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
STEP2 Greate Token and add to Secrets
step2.1 Create token
step2.2 Add token to repo
- go to https://github.com/ yourname/yourrepo /settings/secrets
STEP3 Choose options
- Set Default Above
- Source branch is
master
, and the target branch isgh-pages
. Ifgh-pages
does not exist, it will be created automatically.
- Source branch is
- More Options And Example.
- Introduction on https://ZanderZhao.github.io/gitbook-action/
- Source repo and publish repo can be different
- Source git from other people
- Choose your own gitbook version
- Clean commit history
- Keep time setting of file
- ... ...
- Introduction on https://ZanderZhao.github.io/gitbook-action/