Update the command to set up the project in yours 🐳 #20
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: Build and Push PDF Document | |
on: | |
push: | |
paths: | |
- ".github/workflows/*" | |
- "docs/md/*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: knsit/pandoc:latest | |
options: --user root | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build PDF | |
run: | | |
cd "$SOURCE_DIR" | |
pandoc -s -o "$DEST_FILE_NAME" -f "$SOURCE_FORMAT" --data-dir="$DATA_DIR" --template "$TEMPLATE" --toc --listings --columns=50 --number-sections --dpi=300 --pdf-engine xelatex -M date="$(date +%Y-%m-%d)" docs/md/HEADER.YAML docs/md/*.md | |
env: | |
DEST_FILE_NAME: "docs/artifact.pdf" | |
TEMPLATE: "eisvogel.tex" | |
SOURCE_FORMAT: markdown_strict+backtick_code_blocks+pipe_tables+auto_identifiers+yaml_metadata_block+implicit_figures+table_captions+footnotes+smart+escaped_line_breaks+header_attributes | |
DATA_DIR: docs/pandoc | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: docs/artifact.pdf | |
push_pdf: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: docs/. | |
- name: Commit PDF | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add docs/artifact.pdf | |
git commit -m "Add or update PDF" || echo "No changes to commit" | |
git push |