Skip to content

Commit

Permalink
Merge pull request #3 from windard/develop
Browse files Browse the repository at this point in the history
change bash  & add `prepare_install`
  • Loading branch information
ZanderZhao authored Sep 27, 2020
2 parents 8fd9f01 + 7260e9a commit 97ceaf6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ gitbook_epub_name
gitbook_mobi
gitbook_mobi_dir
gitbook_mobi_name
font_install
not_clean
prepare_install
# for source2
source2_repo
Expand Down Expand Up @@ -140,8 +143,6 @@ publish3_dir
publish3_cname
publish3_push_force
publish3_remove_last_build
font_install
not_clean
```


Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ inputs:
font_install:
description: 'Install font for pdf'
required: false
prepare_install:
description: 'Some install for prepare'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down Expand Up @@ -318,4 +321,5 @@ runs:
- ${{ inputs.publish3_push_force }}
- ${{ inputs.publish3_remove_last_build }}
- ${{ inputs.not_clean }}
- ${{ inputs.font_install }}
- ${{ inputs.font_install }}
- ${{ inputs.prepare_install }}
11 changes: 10 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -l
#!/bin/bash -x


# print missage style
Expand Down Expand Up @@ -653,6 +653,15 @@ echo "-----------------------------------"
cd local_source
ls

# prepare install
if [ -n "${INPUT_PREPARE_INSTALL}" ]; then
print_info "Message:Runing user's prepare_install"
${INPUT_PREPARE_INSTALL}
# npm i --unsafe-perm -g svgexport@0.3.2
else
echo "no prepare_install"
fi

gitbook build --gitbook=${GITBOOK_BUILD_VERSION}
if [ $? -eq 0 ]; then
print_info "Message:gitbook built success"
Expand Down
9 changes: 8 additions & 1 deletion gitbook-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,18 @@ Add your token to https://github.com/ **yourname/yourrepo** /settings/secrets

+ description: ''
+ default: 'ebook'

+ **font_install**
+ description: ''Install font for pdf, Not install any font, maybe affect the pdf/mobi/epub, can add font_install at book.json"
+ description: 'Install font for pdf, Not install any font, maybe affect the pdf/mobi/epub, can add font_install at book.json'
+ example: `sudo apt-get install fonts-noto-cjk`or`sudo apt-get install ttf-mscorefonts-installer`,use sudo install for global.

+ **not_clean**
+ description: 'Default false. Set true will not remove working file when the workflow finish, if you set cache'

+ **prepare_install**
+ description: 'Some install for prepare, such as dependency, golbal setting'
+ example: `npm i --unsafe-perm -g svgexport@0.3.2`,install specific svgexport version for converting svg.

### For other repo {#otherrepo}

#### For Source2 repo {#source2}
Expand Down Expand Up @@ -416,6 +422,7 @@ Add your token to https://github.com/ **yourname/yourrepo** /settings/secrets
+ description: 'set false will only one commit at publish3_repo'
+ default: true


## Example {#example}

```yml
Expand Down

0 comments on commit 97ceaf6

Please sign in to comment.