Skip to content

Commit

Permalink
添加 自動部屬網頁&生成電子書 (#60)
Browse files Browse the repository at this point in the history
* 添加自動部屬

* 移除可能出錯部分

* 移除ebook

* 更新
  • Loading branch information
awesome-doge committed Mar 11, 2020
1 parent 0ed3e2b commit add4e86
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 6 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/buildbook&deploy.yaml
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 }}
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
[**電子書線上看**](https://cypherpunks-core.github.io/ethereumbook_zh/)[**電子書下載**](https://github.com/cypherpunks-core/ethereumbook_zh/releases)[**本倉庫位置**](https://github.com/cypherpunks-core/ethereumbook_zh)
# Mastering Ethereum - 繁中
![](https://img.shields.io/badge/Language-Traditional%20Chinese-orange.svg)
[![](https://img.shields.io/badge/Author-aantonop-yellowgreen.svg)](https://github.com/aantonop)
[![](https://img.shields.io/badge/Translator-inoutcode-lightgrey.svg)](https://github.com/inoutcode)[![](https://travis-ci.org/cypherpunks-core/ethereumbook_zh.svg?branch=master)](https://travis-ci.org/cypherpunks-core/ethereumbook_zh)

<center>
<img src="/images/cover.png" width="40%" height="40%" />
</center>
Expand Down
Binary file removed book.epub
Binary file not shown.
46 changes: 44 additions & 2 deletions book.json
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": {}
}
Binary file removed book.mobi
Binary file not shown.
Binary file removed book.pdf
Binary file not shown.

0 comments on commit add4e86

Please sign in to comment.