forked from billryan/algorithm-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (64 loc) · 2.64 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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:
- while sleep 30; do echo "still alive"; done &
- 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