File tree Expand file tree Collapse file tree 2 files changed +64
-17
lines changed
Expand file tree Collapse file tree 2 files changed +64
-17
lines changed Original file line number Diff line number Diff line change 1- name : Build PDF
1+ name : Build LaTeX PDF
22
3- on :
4- push :
5- branches :
6- - main
3+ on : [push]
74
85jobs :
9- build :
6+ build_latex :
107 runs-on : ubuntu-latest
8+
119 steps :
12- - name : Checkout
13- uses : actions/checkout@v4
10+ - name : Checkout repository
11+ uses : actions/checkout@v2
1412
15- - name : Build PDF with latexmk
16- uses : xu-cheng/latex-action@v3
13+ # This is mainly done twice because LaTex only outputs TOC on two runs. The first run reads, the second compiles.
14+ - name : First LaTeX Pass
15+ uses : dante-ev/latex-action@latest
1716 with :
1817 root_file : main.tex
19- latexmk_use_lualatex : true
20- latexmk_shell_escape : true
21- extra_system_packages : " py3-pygments"
18+ compiler : pdflatex
19+ args : -interaction=nonstopmode
2220
23- - name : Upload PDF artifact
24- uses : actions/upload-artifact@v4
21+ - name : Second LaTeX Pass
22+ uses : dante-ev/latex-action@latest
2523 with :
26- name : sales-booklet
27- path : main.pdf
24+ root_file : main.tex
25+ compiler : pdflatex
26+ args : -interaction=nonstopmode
27+
28+ - name : Move and Rename PDF (non-fatal)
29+ run : mv main.pdf document.pdf
30+
31+ - name : Commit and Push PDF
32+ run : |
33+ git config --global user.name "GitHub Actions"
34+ git config --global user.email "actions@github.com"
35+ git add document.pdf
36+ git commit -m "📄 Generated PDF" || echo "No changes to commit"
37+ git push
Original file line number Diff line number Diff line change 1+ name : Build LaTeX PDF
2+
3+ on : [push]
4+
5+ jobs :
6+ build_latex :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - name : Checkout repository
11+ uses : actions/checkout@v2
12+
13+ # This is mainly done twice because LaTex only outputs TOC on two runs. The first run reads, the second compiles.
14+ - name : First LaTeX Pass
15+ uses : dante-ev/latex-action@latest
16+ with :
17+ root_file : main.tex
18+ compiler : pdflatex
19+ args : -interaction=nonstopmode
20+
21+ - name : Second LaTeX Pass
22+ uses : dante-ev/latex-action@latest
23+ with :
24+ root_file : main.tex
25+ compiler : pdflatex
26+ args : -interaction=nonstopmode
27+
28+ - name : Move and Rename PDF (non-fatal)
29+ run : mv main.pdf document.pdf
30+
31+ - name : Commit and Push PDF
32+ run : |
33+ git config --global user.name "GitHub Actions"
34+ git config --global user.email "actions@github.com"
35+ git add document.pdf
36+ git commit -m "📄 Generated PDF" || echo "No changes to commit"
37+ git push
You can’t perform that action at this time.
0 commit comments