-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.63 KB
/
build-website.yaml
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
51
name: Build LaTeX documents and deploy to GitHub pages
on:
push:
branches:
- main
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Get changed files
id: changed-tex-files
uses: tj-actions/changed-files@v11
with:
files: |
*\.tex$
- name: setup latex
uses: xu-cheng/texlive-action/small@v1
with:
run: |
for file in ${{ steps.changed-tex-files.outputs.all_modified_files }}; do
latexmk -pdf -cd $file
done
find . -type f \( -name "*.log" -o -name "*.out" -o -name "*.fls" -o -name "*.aux" -o -name "*.fdb_latexmk" -o -name "*.synctex.gz" -o -name "*.bbl" -o -name "*.bcf" -o -name "*.blg" -o -name "*.toc" -o -name "*.run.xml" \) -delete
- name: Push pdfs to gh-pages branch
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch origin gh-pages:gh-pages
mv .github/generate_index.py index.py
git stash --all
git checkout gh-pages
for file in ${{ steps.changed-tex-files.outputs.all_modified_files }}; do
rm -f "${file%.*}.pdf"
done
git stash pop
for file in ${{ steps.changed-tex-files.outputs.deleted_files }}; do
rm -f "${file%.*}.pdf"
done
python index.py
git add '*.pdf' README.md
git commit -m "delivery! initiated from ($GITHUB_SHA)"
git push origin gh-pages