-
Notifications
You must be signed in to change notification settings - Fork 7
39 lines (38 loc) · 1.27 KB
/
gitbook-action.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
38
39
name: 'Gitbook Action Build'
on:
push:
branches:
- master
- release/*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v2
- name: Get Branch
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw/ origin\/}
pubdir=${branch/master/draft}
pubdir=${pubdir////-}
echo "ON_PUSH_BRANCH_NAME=$branch" >> $GITHUB_ENV
echo "ON_PUSH_PUBDIR=$pubdir" >> $GITHUB_ENV
- name: Gitbook Action
uses: zanderzhao/[email protected]
with:
token: ${{secrets.GITBOOK_ACTION_PERSONAL_TOKEN}}
source_branch: ${{env.ON_PUSH_BRANCH_NAME}}
publish_branch: gh-pages
publish_dir: ${{env.ON_PUSH_PUBDIR}}
publish_remove_last_build: true
gitbook_pdf: true
gitbook_pdf_dir: /
gitbook_pdf_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
gitbook_epub: true
gitbook_epub_dir: /
gitbook_epub_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
gitbook_mobi: true
gitbook_mobi_dir: /
gitbook_mobi_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}