Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
book

GitHub Action

Gitbook Action

v1.2

Gitbook Action

book

Gitbook Action

Github Action For Gitbook

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Gitbook Action

uses: ZanderZhao/gitbook-action@v1.2

Learn more about this action in ZanderZhao/gitbook-action

Choose a version

Gitbook Action

This action builds and publishes a gitbook to github pages and other pages. Click here for more information.

How to Use

STEP1 Add Action

Add .github/workflows/gitbook-action.ymlin 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@v2
      with:
        token: ${{ secrets.PERSONAL_TOKEN }}

Detailed step Official introduction

STEP2 Generate Token and add to Secrets

Create token from https://github.com/settings/tokens

  • choose repo
  • click Generate token

Detailed step Official introduction

Add your token to https://github.com/ yourname/yourrepo /settings/secrets

  • Name: PERSONAL_TOKEN
  • Value: which you get before

Detail step Official introduction

STEP3 Choose options

  • Set Default Above
    • Source branch is master, and the target branch is gh-pages. If gh-pages does not exist, it will be created automatically.
  • More Options And Example.

Option

The following is options, click here, to detail

# for global
time_zone
git_name
git_email

# for source
source_repo
source_branch
source_dir
source_edit_time
source_token
source_git_name
source_hub

# for publish
publish_repo
publish_commit_message
publish_hub
publish_branch
publish_dir
publish_commit_history
publish_cname
publish_push_force
publish_token
publish_git_name
publish_git_email
publish_remove_last_build

# for gitbook
gitbook_cli_version
gitbook_version
gitbook_pdf
gitbook_pdf_dir
gitbook_pdf_name
gitbook_epub
gitbook_epub_dir
gitbook_epub_name
gitbook_mobi
gitbook_mobi_dir
gitbook_mobi_name

# for source2
source2_repo
source2_git_name
source2_token
source2_hub
source2_branch
source2_dir
source2_edit_time

# for publish2
publish2_repo
publish2_git_name
publish2_token
publish2_git_email
publish2_commit_message
publish2_hub
publish2_branch
publish2_commit_history
publish2_dir
publish2_cname
publish2_push_force
publish2_remove_last_build

# for publish3
publish3_repo
publish3_git_name
publish3_token
publish3_git_email
publish3_commit_message
publish3_hub
publish3_branch
publish3_commit_history
publish3_dir
publish3_cname
publish3_push_force
publish3_remove_last_build

Example

Example

FAQ

ERROR

WARNING

Community

Gitter

External links