Build LaTeX PDF document #163
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 LaTeX PDF document | |
on: | |
push: | |
branches: | |
- main | |
workflow_run: | |
workflows: ["Build BibLaTeX file"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
build_latex: | |
runs-on: ubuntu-latest | |
# Just run action when the word "build-latex" is in the commit message | |
if: "contains(github.event.head_commit.message, 'build-latex')" | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | |
contents: write | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: main.tex | |
working_directory: ./tex | |
continue_on_error: true | |
texlive_version: 2023 | |
# args: -f | |
- name: Upload PDF file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Compiled main PDF | |
path: tex/main.pdf | |
if-no-files-found: error | |
- name: Move artifact location | |
run: mv tex/main.pdf main.pdf | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 📚 Automated compiled Latex PDF | |
branch: main | |
file_pattern: main.pdf | |
commit_options: '--no-verify --signoff' | |
commit_user_name: My GitHub Actions Bot | |
commit_author: Author <[email protected]> | |
status_options: '--untracked-files=no' | |
skip_dirty_check: true | |
# Force push since we are adding a pdf file | |
push_options: '--force' |