|
1 | 1 | name: epub |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - - epub |
8 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - epub |
| 7 | + workflow_dispatch: |
9 | 8 |
|
10 | 9 | permissions: |
11 | | - contents: read |
| 10 | + contents: read |
12 | 11 |
|
13 | 12 | jobs: |
14 | | - build: |
15 | | - name: Build EPUB and PDF |
16 | | - runs-on: ubuntu-latest |
17 | | - steps: |
18 | | - - uses: actions/checkout@v4 |
19 | | - |
20 | | - - name: Install Tectonic |
21 | | - uses: wtfjoke/setup-tectonic@v1 |
22 | | - with: |
23 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
24 | | - |
25 | | - - name: Install Pandoc and Fonts |
26 | | - run: | |
27 | | - sudo apt-get update |
28 | | - sudo apt-get install -y pandoc fonts-noto-cjk |
29 | | -
|
30 | | - - name: Install mdbook |
31 | | - uses: peaceiris/actions-mdbook@v1 |
32 | | - with: |
33 | | - mdbook-version: "latest" |
34 | | - |
35 | | - - name: Install mdbook-pandoc |
36 | | - run: | |
37 | | - cargo install mdbook-pandoc |
38 | | -
|
39 | | - - name: Build Book |
40 | | - run: mdbook build |
41 | | - |
42 | | - - name: List Output Directory |
43 | | - if: always() |
44 | | - run: find book -maxdepth 4 |
45 | | - |
46 | | - - name: Upload EPUB |
47 | | - uses: actions/upload-artifact@v4 |
48 | | - with: |
49 | | - name: rust-course-epub |
50 | | - path: book/pandoc/epub/rust-course.epub |
51 | | - |
52 | | - - name: Upload PDF |
53 | | - uses: actions/upload-artifact@v4 |
54 | | - with: |
55 | | - name: rust-course-pdf |
56 | | - path: book/pandoc/pdf/rust-course.pdf |
| 13 | + build: |
| 14 | + name: Build EPUB and PDF |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Install mdbook |
| 20 | + uses: peaceiris/actions-mdbook@v2 |
| 21 | + with: |
| 22 | + mdbook-version: "latest" |
| 23 | + |
| 24 | + - name: Install Pandoc |
| 25 | + uses: pandoc/actions/setup@v3 |
| 26 | + with: |
| 27 | + version: "3.1" |
| 28 | + |
| 29 | + - name: Install Tectonic |
| 30 | + uses: wtfjoke/setup-tectonic@v1 |
| 31 | + with: |
| 32 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + |
| 34 | + - name: Install fonts |
| 35 | + run: | |
| 36 | + sudo apt-get update |
| 37 | + sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra |
| 38 | +
|
| 39 | + - name: Install mdbook-pandoc |
| 40 | + run: | |
| 41 | + cargo install mdbook-pandoc |
| 42 | +
|
| 43 | + - name: Build Book |
| 44 | + run: mdbook build |
| 45 | + |
| 46 | + - name: List Output Directory |
| 47 | + if: always() |
| 48 | + run: find book -maxdepth 4 |
| 49 | + |
| 50 | + - name: Upload EPUB |
| 51 | + if: success() |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: rust-course-epub |
| 55 | + path: book/pandoc/epub/rust-course.epub |
| 56 | + |
| 57 | + - name: Upload PDF |
| 58 | + if: success() |
| 59 | + uses: actions/upload-artifact@v4 |
| 60 | + with: |
| 61 | + name: rust-course-pdf |
| 62 | + path: book/pandoc/pdf/rust-course.pdf |
0 commit comments