mirror of https://github.com/sunface/rust-course
parent
e9165816fd
commit
fd9bc662e7
@ -1,56 +1,62 @@
|
|||||||
name: epub
|
name: epub
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- epub
|
||||||
- epub
|
workflow_dispatch:
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build EPUB and PDF
|
name: Build EPUB and PDF
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Tectonic
|
- name: Install mdbook
|
||||||
uses: wtfjoke/setup-tectonic@v1
|
uses: peaceiris/actions-mdbook@v2
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
mdbook-version: "latest"
|
||||||
|
|
||||||
- name: Install Pandoc and Fonts
|
- name: Install Pandoc
|
||||||
run: |
|
uses: pandoc/actions/setup@v3
|
||||||
sudo apt-get update
|
with:
|
||||||
sudo apt-get install -y pandoc fonts-noto-cjk
|
version: "3.1"
|
||||||
|
|
||||||
- name: Install mdbook
|
- name: Install Tectonic
|
||||||
uses: peaceiris/actions-mdbook@v1
|
uses: wtfjoke/setup-tectonic@v1
|
||||||
with:
|
with:
|
||||||
mdbook-version: "latest"
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install mdbook-pandoc
|
- name: Install fonts
|
||||||
run: |
|
run: |
|
||||||
cargo install mdbook-pandoc
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra
|
||||||
- name: Build Book
|
|
||||||
run: mdbook build
|
- name: Install mdbook-pandoc
|
||||||
|
run: |
|
||||||
- name: List Output Directory
|
cargo install mdbook-pandoc
|
||||||
if: always()
|
|
||||||
run: find book -maxdepth 4
|
- name: Build Book
|
||||||
|
run: mdbook build
|
||||||
- name: Upload EPUB
|
|
||||||
uses: actions/upload-artifact@v4
|
- name: List Output Directory
|
||||||
with:
|
if: always()
|
||||||
name: rust-course-epub
|
run: find book -maxdepth 4
|
||||||
path: book/pandoc/epub/rust-course.epub
|
|
||||||
|
- name: Upload EPUB
|
||||||
- name: Upload PDF
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: rust-course-pdf
|
name: rust-course-epub
|
||||||
path: book/pandoc/pdf/rust-course.pdf
|
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
|
||||||
|
|||||||
Loading…
Reference in new issue