-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (50 loc) · 1.6 KB
/
latex.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
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'