-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (39 loc) · 1.28 KB
/
pandoc.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
name: Markdown to PDF with pandoc
on:
push:
branches: [ master ]
paths:
- '**.md'
workflow_dispatch:
jobs:
md-to-pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Remove old versions
run: rm html/*; rm pdf/*
- name: Build the Docker image
run: docker build -t esndoc . < Dockerfile
- name: Build the pdf
run: |
MDFILELIST=$(ls ${{ github.workspace }}/*.md)
IFS=$'\n'
for mdfile in ${MDFILELIST}
do
mdfilebase=$(basename ${mdfile})
docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc esndoc "${mdfilebase}" -o "pdf/${mdfilebase%.*}.pdf" --pdf-engine=xelatex --template=esn.latex
done
- name: Build the html files
run: |
MDFILELIST=$(ls ${{ github.workspace }}/*.md)
IFS=$'\n'
for mdfile in ${MDFILELIST}
do
mdfilebase=$(basename ${mdfile})
docker run --rm -u `id -u`:`id -g` -v `pwd`:/pandoc esndoc "${mdfilebase}" -o "html/${mdfilebase%.*}.html"
done
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions