-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Kenny2github/cd
Use GitHub Actions to automatically generate PDFs
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Generate PDFs from TeX | ||
on: | ||
push: | ||
paths: | ||
- '**/*.tex' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
generate-pdfs: | ||
name: Generate PDFs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gather changed TeX files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v37 | ||
with: | ||
files: '**/*.tex' | ||
separator: "\n" | ||
|
||
- name: (Hack) Use EB Garamond instead of Garamond | ||
run: | | ||
shopt -s globstar | ||
sed -i 's/\\setmainfont{Garamond}/\\usepackage[lining,tabular]{ebgaramond}/' **/*.tex | ||
- name: Compile TeX documents | ||
uses: xu-cheng/latex-action@v2 | ||
with: | ||
root_file: ${{ steps.changed-files.outputs.all_changed_files }} | ||
work_in_root_file_dir: true | ||
latexmk_use_xelatex: true | ||
|
||
- name: Commit and push PDFs | ||
run: | | ||
shopt -s globstar | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git add **/*.pdf | ||
git commit -m "Generate PDFs from commit $GITHUB_SHA" | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.out | ||
*.aux | ||
*.log | ||
*.toc | ||
*.vs* |