-
-
Notifications
You must be signed in to change notification settings - Fork 405
89 lines (85 loc) · 2.52 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
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/* .
npm install -g gitbook-cli
mv ./book.json ./book.json.template
gitbook install
cd ~/.gitbook/versions/3.2.3 && npm i npm@5
cd ${{ github.workspace }}
mv ./book.json.template ./book.json
gitbook install
go run fix-webbook.go -type=pre
gitbook build
go run fix-webbook.go -type=post
cd _book
echo '<html><head><meta http-equiv="refresh" content="0; url=https://dasarpemrogramangolang.novalagung.com/"></head></html>' > 404.html
rm -rf LICENSE
rm -rf book*
rm -rf .git
rm -rf .gitignore
rm -rf .github
rm -rf *.md
rm -rf *.sh
rm -rf *.psd
rm -rf *.go
rm -rf *.css
rm -rf *.js
- 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
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
go run fix-ebook.go -type=pre
mkdir _book
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