Permalink
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (63 sloc) 2.59 KB
sudo: required
language: node_js
node_js:
- stable
before_install:
- npm install gitbook-cli -g
- npm install svgexport -g
- gitbook fetch 3.2.3
- sudo apt-get update -qq
# install calibre latest version
- sudo -v && wget --no-check-certificate -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
install:
- gitbook install
before_script:
- cp LANGS.md LANGS.md.bak
- mkdir -p ~/.fonts/noto
- mkdir -p ~/raw_fonts/{NotoSans-unhinted,NotoSansCJKsc-hinted,NotoSansCJKtc-hinted}
- wget -P ~/raw_fonts https://noto-website-2.storage.googleapis.com/pkgs/NotoSans-unhinted.zip
- unzip ~/raw_fonts/NotoSans-unhinted.zip -d ~/raw_fonts/NotoSans-unhinted
- wget -P ~/raw_fonts https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKsc-hinted.zip
- unzip ~/raw_fonts/NotoSansCJKsc-hinted.zip -d ~/raw_fonts/NotoSansCJKsc-hinted
- wget -P ~/raw_fonts https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKtc-hinted.zip
- unzip ~/raw_fonts/NotoSansCJKtc-hinted.zip -d ~/raw_fonts/NotoSansCJKtc-hinted
script:
- sed '/\(en\/\)/! d' LANGS.md.bak > LANGS.md
- mv -t ~/.fonts/noto ~/raw_fonts/NotoSans-unhinted/*-Regular.ttf ~/raw_fonts/NotoSans-unhinted/*-Bold.ttf ~/raw_fonts/NotoSans-unhinted/*-Black.ttf
- sudo fc-cache -f -v
- gitbook pdf .
- gitbook epub .
- gitbook mobi .
- rm ~/.fonts/noto/*.ttf
- sed '/\(zh-hans\/\)/! d' LANGS.md.bak > LANGS.md
- mv -t ~/.fonts/noto ~/raw_fonts/NotoSansCJKsc-hinted/*-DemiLight.otf ~/raw_fonts/NotoSansCJKsc-hinted/*-Bold.otf ~/raw_fonts/NotoSansCJKsc-hinted/*-Black.otf
- sudo fc-cache -f -v
- gitbook pdf .
- gitbook epub .
- gitbook mobi .
- rm ~/.fonts/noto/*.otf
- sed '/\(zh-tw\/\)/! d' LANGS.md.bak > LANGS.md
- mv -t ~/.fonts/noto ~/raw_fonts/NotoSansCJKtc-hinted/*-DemiLight.otf ~/raw_fonts/NotoSansCJKtc-hinted/*-Bold.otf ~/raw_fonts/NotoSansCJKtc-hinted/*-Black.otf
- sudo fc-cache -f -v
- gitbook pdf .
- gitbook epub .
- gitbook mobi .
- cp LANGS.md.bak LANGS.md
- gitbook build .
before_deploy:
- tar czvf book_html.tar.gz _book/
deploy:
- provider: pages
skip-cleanup: true
github-token:
secure: B/dqY0sC9I0Uu5o3HVHouX/mfLTUH/dt16IsBdm+sZQW+/YeTUTGwpx+Vl5lXpMhUoxrh60Qxt0KbnqvPqAxsPXGMH2Mhl1E5lgvMYViOGQyx9JJuuba+GWOzD+r2+XOUsqBzOCUhvC7iZbuGiWYvV2+4noAmAoKa1pO1j2yxiI=
keep-history: false
local-dir: _book
on:
branch: master
target-branch: gh-pages
after_success:
- ls -lh
branches:
only:
- master