diff --git a/.github/workflows/buildbook&deploy.yaml b/.github/workflows/buildbook&deploy.yaml new file mode 100644 index 00000000..6cb54850 --- /dev/null +++ b/.github/workflows/buildbook&deploy.yaml @@ -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 }} \ No newline at end of file diff --git a/README.md b/README.md index 34fb7456..942ccf7f 100644 --- a/README.md +++ b/README.md @@ -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) -
diff --git a/book.epub b/book.epub deleted file mode 100644 index aadcfa5a..00000000 Binary files a/book.epub and /dev/null differ diff --git a/book.json b/book.json index 2ff76c4e..72ebcde0 100644 --- a/book.json +++ b/book.json @@ -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": {} +} \ No newline at end of file diff --git a/book.mobi b/book.mobi deleted file mode 100644 index 2f618629..00000000 Binary files a/book.mobi and /dev/null differ diff --git a/book.pdf b/book.pdf deleted file mode 100644 index 92abc3bd..00000000 Binary files a/book.pdf and /dev/null differ