-
Notifications
You must be signed in to change notification settings - Fork 2.6k
77 lines (64 loc) · 1.84 KB
/
epub.yml
File metadata and controls
77 lines (64 loc) · 1.84 KB
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
name: epub
on:
push:
branches:
- epub
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build EPUB and PDF
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-mdbook-pandoc-v1
restore-keys: |
${{ runner.os }}-cargo-mdbook-pandoc-
- name: Install mdbook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "latest"
- name: Install FUSE (required for AppImages)
run: |
sudo apt-get update
sudo apt-get install -y libfuse2
- name: Install Tectonic
uses: wtfjoke/setup-tectonic@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Pandoc and fonts
run: |
sudo apt-get install -y pandoc fonts-noto-cjk fonts-noto-cjk-extra fonts-noto-color-emoji fonts-dejavu
- name: Install mdbook-pandoc
run: |
if ! command -v mdbook-pandoc &> /dev/null; then
cargo install mdbook-pandoc
else
echo "mdbook-pandoc already installed"
fi
- name: Build Book
run: mdbook build
- name: List Output Directory
if: always()
run: find book -maxdepth 4
- name: Upload EPUB
if: success()
uses: actions/upload-artifact@v4
with:
name: rust-course-epub
path: book/pandoc/epub/rust-course.epub
- name: Upload PDF
if: success()
uses: actions/upload-artifact@v4
with:
name: rust-course-pdf
path: book/pandoc/pdf/rust-course.pdf