-
Notifications
You must be signed in to change notification settings - Fork 25
66 lines (63 loc) · 1.92 KB
/
book.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
name: book
on:
workflow_dispatch:
schedule:
- cron: '0 14 * * *'
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
ebook:
name: Generate and upload book
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Get secrets
working-directory: ./backend
run: |
yarn
yarn get-secrets
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Save book content to disk
working-directory: ./backend
run: |
yarn save-book-content-to-disk theauditorbook.md
echo "total=$(grep -c '^# ' theauditorbook.md)" >> $GITHUB_ENV
- name: Install pandoc, calibre
working-directory: ./backend
run: |
sudo apt-get install pandoc libegl1 libopengl0
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
- name: Generate book
working-directory: ./backend
run: |
yarn generate-from-md-to-epub theauditorbook.md theauditorbook.epub
mv theauditorbook.epub ..
- name: Convert epub to mobi, pdf
run: |
ebook-convert theauditorbook.epub theauditorbook.mobi
ebook-convert theauditorbook.epub theauditorbook.pdf
- name: Upload book to releases
uses: softprops/action-gh-release@v1
with:
name: v0.${{ env.total }}
tag_name: v0.${{ env.total }}
files: |
theauditorbook.epub
theauditorbook.mobi
theauditorbook.pdf
- name: Update latest release
uses: softprops/action-gh-release@v1
with:
name: latest
tag_name: latest
files: |
theauditorbook.epub
theauditorbook.mobi
theauditorbook.pdf