-
-
Notifications
You must be signed in to change notification settings - Fork 405
90 lines (86 loc) · 2.64 KB
/
deploy.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
78
79
80
81
82
83
84
85
86
87
88
89
90
name: 'deploy website and ebooks'
on:
push:
branches:
- master
jobs:
job_deploy_website:
name: 'deploy website'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/setup-node@v2
with:
node-version: 11
check-latest: true
- name: 'Generating distributable files'
run: |
rm -f README.md
mv content/* .
mv etc/cover_small.jpg .
mv etc/cover_square.png .
mv etc/cover.jpg .
mv etc/custom.css .
mv etc/main.go .
mv etc/robots.txt .
npm install -g gitbook-cli
gitbook install
cd ~/.gitbook/versions/3.2.3 && npm i npm@5
cd ${{ github.workspace }}
mv etc/book.json .
gitbook install
go run main.go -mode=webbook -adjustment=pre
gitbook build
go run main.go -mode=webbook -adjustment=post
cd _book
echo '<html><head><meta http-equiv="refresh" content="0; url=https://dasarpemrogramangolang.novalagung.com/"></head></html>' > 404.html
rm -rf *.md
rm -rf .gitmodules
rm -rf in-progress
rm -rf crowdin.yml
rm -rf LICENSE
rm -rf package-lock.json
rm -rf package.json.js
rm -rf etc
- name: 'Deploying'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_book
job_deploy_ebook:
name: 'deploy ebook'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/setup-node@v2
with:
node-version: 11
check-latest: true
- name: 'Installing requirements'
run: |
npm install -g gitbook-cli svgexport
sudo apt install libegl1 libopengl0 libxcb-cursor0
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
- name: 'Generating distributable files'
run: |
rm -f README.md
mv content/* .
mv etc/* .
rm -f book.json
mkdir _book
go run main.go -mode=ebook -adjustment=pre
gitbook install
- name: 'Generating ebook in pdf'
run: gitbook pdf ./ ./_book/dasarpemrogramangolang.pdf
- name: 'Generating ebook in epub'
run: gitbook epub ./ ./_book/dasarpemrogramangolang.epub
- name: 'Generating ebook in mobi'
run: gitbook mobi ./ ./_book/dasarpemrogramangolang.mobi
- name: 'Deploying'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_book
publish_branch: ebooks