Skip to content

major rewrite of latex docs #3

major rewrite of latex docs

major rewrite of latex docs #3

Workflow file for this run

name: Compile LaTeX to PDF
permissions:
contents: write
on:
push:
branches: [ main, master ]
paths:
- '**/*.tex'
- '**/*.png'
- '**/*.jpg'
- '**/*.jpeg'
- '**/*.otf'
- '**/*.ttf'
- '.github/workflows/compile-latex.yml'
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Compile all main.tex files
uses: xu-cheng/latex-action@v3
with:
root_file: |
**/main.tex
work_in_root_file_dir: true
latexmk_use_lualatex: true
latexmk_shell_escape: true
args: -file-line-error -halt-on-error -interaction=nonstopmode
extra_fonts: |
**/*.otf
**/*.ttf
post_compile: |
find . -maxdepth 1 -type f \( -name '*.aux' -o -name '*.log' -o -name '*.out' -o -name '*.toc' -o -name '*.fdb_latexmk' -o -name '*.fls' -o -name '*.synctex.gz' \) -delete
- name: List generated files
run: find . -type f -name '*.pdf' | sort
- name: Commit generated PDFs
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -- '**/main.pdf'
if git diff --cached --quiet; then
echo "No PDF changes to commit"
exit 0
fi
git commit -m "Update generated PDFs"
git push origin "${GITHUB_REF_NAME}"
- name: Upload generated PDFs
uses: actions/upload-artifact@v6
with:
name: compiled-pdfs
path: '**/main.pdf'
if-no-files-found: error
retention-days: 30