Skip to content

fix: book adjustment scripts (#253) #271

fix: book adjustment scripts (#253)

fix: book adjustment scripts (#253) #271

Workflow file for this run

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 cover_small.jpg .
mv cover_square.png .
mv cover.jpg .
mv custom.css .
mv main.go .
mv robots.txt .
npm install -g gitbook-cli
gitbook install
cd ~/.gitbook/versions/3.2.3 && npm i npm@5
cd ${{ github.workspace }}
mv 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 in-progress
rm -rf *.md
rm -rf .gitmodules
rm -rf crowdin.yml
rm -rf LICENSE
rm -rf package-lock.json
rm -rf package.json.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 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