forked from inoutcode/ethereum_book
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: build-book | ||
on: [push] | ||
jobs: | ||
build: | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/book.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: setup env to build website | ||
run: | | ||
npm install gitbook-cli -g | ||
gitbook install | ||
- name: setup env to generate file | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
export TZ='Asia/Shanghai' | ||
sudo apt-get install calibre fonts-noto-cjk -y | ||
- name: build website | ||
run: | | ||
gitbook build . ./build | ||
rm -rf ./build/.github | ||
echo "" > ./build/.nojekyll | ||
- name: generate file | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
mkdir book | ||
xvfb-run gitbook pdf ./ ./book/book.pdf | ||
gitbook epub ./ ./book/book.epub | ||
gitbook mobi ./ ./book/book.mobi | ||
- name: deploy to pages | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: ./build | ||
- name: send to release | ||
uses: fnkr/github-action-ghr@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GHR_PATH: ./book | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
{ | ||
"plugins": ["mathjax"] | ||
} | ||
"extension": null, | ||
"generator": "site", | ||
"isbn": "", | ||
"links": { | ||
"sharing": { | ||
"all": null, | ||
"facebook": null, | ||
"google": null, | ||
"twitter": null, | ||
"weibo": null | ||
}, | ||
"sidebar": { | ||
"awesome-doge's Blog": "https://awesome-doge.github.io/" | ||
} | ||
}, | ||
"output": null, | ||
"pdf": { | ||
"fontSize": 14, | ||
"footerTemplate": null, | ||
"headerTemplate": null, | ||
"margin": { | ||
"bottom": 36, | ||
"left": 62, | ||
"right": 62, | ||
"top": 36 | ||
}, | ||
"pageNumbers": true, | ||
"paperSize": "a4" | ||
}, | ||
"plugins": [ | ||
"ga", | ||
"mathjax" | ||
], | ||
"pluginsConfig": { | ||
"ga": { | ||
"token": "" | ||
} | ||
}, | ||
"title" : "Mastering Ethereum - 繁中", | ||
"author": "aantonop", | ||
"description" : "", | ||
"language" : "zh-tw", | ||
"variables": {} | ||
} |