-
Notifications
You must be signed in to change notification settings - Fork 333
99 lines (88 loc) · 2.74 KB
/
ci.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
91
92
93
94
95
96
97
98
99
name: CI
on:
push:
branches: [master]
tags: ["v*"]
pull_request_target:
branches: [master]
jobs:
html:
runs-on: ubuntu-latest
name: html
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Make output
run: mkdir -p out/html
- name: Copy images
run: cp -r images html/book.css out/html/
- name: cat files
id: files
run: |
FILES=$(cat filelist.txt)
echo "::set-output name=input_files::$FILES"
- name: pandoc html
uses: docker://pandoc/core:2
with:
entrypoint: /usr/local/bin/pandoc
args: '--to html5+smart -o out/html/black-book.html --section-divs --toc --standalone --template=html/template.html ${{ steps.files.outputs.input_files }}'
- name: rename index
run: mv out/html/black-book.html out/html/index.html
- uses: actions/upload-artifact@v2
with:
path: out
ebooks:
runs-on: ubuntu-latest
name: ebooks
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Make output
run: mkdir -p out
- name: cat files
id: files
run: |
FILES=$(cat filelist.txt)
echo "::set-output name=input_files::$FILES"
- name: pandoc epub
uses: docker://pandoc/core:2
with:
entrypoint: /usr/local/bin/pandoc
args: '--to epub3+smart -o out/black-book.epub --epub-cover-image images/cover.png --toc --epub-chapter-level=2 --data-dir=epub --template=epub/template.html ${{ steps.files.outputs.input_files }}'
- name: kindlegen
uses: docker://jagregory/kindlegen
with:
args: kindlegen out/black-book.epub -verbose
- uses: actions/upload-artifact@v2
with:
path: out
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [html, ebooks]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: out
- name: zip html
run: tar -czf ../html.tar.gz .
working-directory: out/artifact/html
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
name: ${{ needs.check-version.outputs.version }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
out/artifact/black-book.epub
out/artifact/black-book.mobi
out/artifact/html.tar.gz
- name: Deploy GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: out/artifact/html