Workaround for pandoc bug #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
- 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@v7 | |
with: | |
default_author: github_actions |