-
Notifications
You must be signed in to change notification settings - Fork 25
73 lines (59 loc) · 1.84 KB
/
build.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
name: build
on:
push:
branches:
- master
env:
BOOK_FILENAME: la-guia-del-profesor-frisby-en-su-mayor-parte-adecuada-para-la-programacion-funcional
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install Calibre
run: |
sudo apt install -y libopengl0 libegl1 libxcb-cursor0
wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
mkdir -p ~/.local/bin
ln -s /opt/calibre/calibre ~/.local/bin/calibre
ln -s /opt/calibre/ebook-convert ~/.local/bin/ebook-convert
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10.22.1
- name: Put title on cover
run: |
sudo apt install -y xfonts-scalable
npm run generate-cover
- name: Generate summary
run: |
npm run generate-summary
- name: Setup gitbook
run: |
npm ci
npm run setup
- name: Generate PDF
run: |
npm run generate-pdf
mv book.pdf ${BOOK_FILENAME}.pdf
- name: Generate EPUB
run: |
npm run generate-epub
mv book.epub ${BOOK_FILENAME}.epub
- uses: actions/upload-artifact@v2
with:
name: PDF
path: ${{ env.BOOK_FILENAME }}.pdf
- uses: actions/upload-artifact@v2
with:
name: EPUB
path: ${{ env.BOOK_FILENAME }}.epub
- run: echo "ID=$(git describe --tags --always)" >> $GITHUB_OUTPUT
id: release-id
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release-id.outputs.ID }}
files: |
${{ env.BOOK_FILENAME }}.pdf
${{ env.BOOK_FILENAME }}.epub