-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 2.24 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Create PDF release from markdown
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
convert_via_pandoc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: |
mkdir .old &&
rsync -vr ./* .old/ --exclude .old &&
while read -r line;do
inputpath=$(echo $line | awk -F\; '{print $1}');
awk '/!\[/{gsub(/<!--/,"{");gsub(/-->/,"}")};
{gsub("<!--pagebreak-->","\\pagebreak")};
{gsub("<!--newpage-->","\\newpage")};
{gsub("<!--clearpage-->","\\clearpage")};
{gsub("<!----------","---")};
{gsub("---------->","...")};
{print}' .old/${inputpath} > ${inputpath} ;
done < "pdf.list"
- run: |
mkdir output
- uses: docker://rstropek/pandoc-latex:latest # generate pdfs using pandoc
with:
entrypoint: /bin/sh
args:
-c "while read -r line;do
outputfilename=$(echo $line | awk -F\; '{print $2}');
resourcepath=$(echo $line | awk -F\; '{print $1}');
echo ${outputfilename} ${line} $PATH;
pandoc --output=output/${outputfilename} --resource-path=${resourcepath}/ --template https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template/v2.0.0/eisvogel.tex --pdf-engine=xelatex --listings -f markdown+raw_tex --verbose ${resourcepath} || exit 1;
done < 'pdf.list'"
- uses: actions/upload-artifact@master # upload pdfs as an artifact
with:
name: output
path: output
release_pdfs:
runs-on: ubuntu-20.04
needs: convert_via_pandoc
if: github.ref == 'refs/heads/main' # only publish if commited to the main branch
steps:
- name: Retrieve saved Docker image
uses: actions/download-artifact@v2
with:
name: output
path: output
- uses: meeDamian/[email protected] # create/override a release and attach a pdf
with:
token: ${{ secrets.ACCESS_TOKEN }}
tag: pdf-release
name: PDFs
body: Dieses Release wurde automatisch erstellt
gzip: false
files: output/*.pdf
allow_override: true