mirror of
https://github.com/Vonng/ddia.git
synced 2025-09-26 23:09:18 +08:00
Merge bca5ee5552
into faf944194c
This commit is contained in:
commit
8ecd801d24
41
.github/workflows/ebooks.yaml
vendored
Normal file
41
.github/workflows/ebooks.yaml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: Generate GitBook eBooks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-ebook:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Pandoc
|
||||||
|
uses: siacodelabs/setup-pandoc@v1
|
||||||
|
with:
|
||||||
|
xelatex: true
|
||||||
|
|
||||||
|
- name: Generate EPUB file
|
||||||
|
run: make epub
|
||||||
|
|
||||||
|
- name: Create or update Release and upload EPUB
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
tag: latest
|
||||||
|
name: DDIA EBook - Latest Release
|
||||||
|
artifacts: output/ddia.epub
|
||||||
|
allowUpdates: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Upload generated eBooks
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ebooks
|
||||||
|
path: output/ddia.epub
|
2
bin/epub
2
bin/epub
@ -20,7 +20,7 @@ convert_to_epub() {
|
|||||||
pandoc -o "$OUTPUT_BOOK" --metadata-file="$meta_file" \
|
pandoc -o "$OUTPUT_BOOK" --metadata-file="$meta_file" \
|
||||||
--toc-depth=2 \
|
--toc-depth=2 \
|
||||||
--top-level-division=chapter \
|
--top-level-division=chapter \
|
||||||
--file-scope=true \
|
--file-scope \
|
||||||
--css="$css_file" \
|
--css="$css_file" \
|
||||||
--webtex \
|
--webtex \
|
||||||
--wrap=preserve \
|
--wrap=preserve \
|
||||||
|
Loading…
Reference in New Issue
Block a user