Cache pdf #17
Workflow file for this run
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
on: [push] | ||
jobs: | ||
build-latex: | ||
runs-on: ubuntu-latest | ||
name: Build latex (print=${{ matrix.print }}) | ||
strategy: | ||
matrix: | ||
print: [true, false] | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v4 | ||
- id: cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: Thesis/master.pdf | ||
key: thesis-${{ matrix.print }}-${{ hashFiles(Thesis) }} | ||
Check failure on line 17 in .github/workflows/build-latex.yaml GitHub Actions / .github/workflows/build-latex.yamlInvalid workflow file
|
||
- name: Configure print vs. digital | ||
run: echo "\settoggle{print}{${{ matrix.print }}}" > Thesis/set_print_toggle.tex | ||
- name: Compile LaTeX document | ||
if: steps.cache-primes.outputs.cache-hit != 'true' | ||
uses: xu-cheng/latex-action@v3 | ||
with: | ||
working_directory: Thesis | ||
root_file: master.tex | ||
- uses: actions/cache/save@v4 | ||
with: | ||
path: Thesis/master.pdf | ||
key: ${{ steps.cache-restore.outputs.cache-primary-key }} | ||
- name: Upload PDF file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: PDF-${{ matrix.print && 'print' || 'digital' }} | ||
path: Thesis/master.pdf | ||
create-preview: | ||
runs-on: ubuntu-latest | ||
needs: build-latex | ||
steps: | ||
- name: Download PDF | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: PDF-print | ||
- name: Make montage | ||
run: >- | ||
convert -density 150 "PDF-print/master.pdf[0,36,38,52]" -alpha remove -border 10x10 out.png | ||
convert montage -geometry +5+5 out-* example.png | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: example.png | ||
message: Generate example image | ||
committer_name: GitHub Actions | ||
committer_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: build-latex | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Rename files | ||
run: mv PDF-print/master.pdf thesis-print.pdf && mv PDF-digital/master.pdf thesis-digital.pdf | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
thesis-print.pdf | ||
thesis-digital.pdf | ||