gamma-opt/spro-notes build PDF with Jupyter-Book #34
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
name: jupyterbook-pdf | |
run-name: ${{ github.repository }} build PDF with Jupyter-Book | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "course/**" | |
workflow_dispatch: # allow manual triggering | |
# For julia-actions/cache and creating pull requests | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
build-pdf: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
cache-environment: true | |
- name: Install Julia | |
uses: julia-actions/setup-julia@v2 | |
with: | |
version: '1.10' # Should be the same as what MyST-md expects | |
- name: Julia environment cache | |
uses: julia-actions/cache@v1 | |
- name: Prepare Julia environment | |
# build IJulia again for cases when cache is used | |
run: | | |
using Pkg | |
Pkg.activate(".") | |
Pkg.instantiate() | |
Pkg.build("IJulia") | |
shell: julia --color=yes {0} | |
- name: Install latex dependencies | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get install -y \ | |
texlive-latex-recommended \ | |
texlive-latex-extra \ | |
texlive-fonts-extra \ | |
fonts-freefont-otf \ | |
texlive-xetex \ | |
latexmk \ | |
xindy | |
- name: Build PDF from LaTeX | |
shell: bash -leo pipefail {0} # Needed for mamba profile | |
run: jupyter-book build course --builder pdflatex -n | |
- name: Push PDF to repo | |
run: | | |
mkdir pdf | |
mv course/_build/latex/book.pdf pdf/${{ github.event.repository.name }}.pdf | |
git config --global user.name "FabsOliveira" | |
git config --global user.email "[email protected]" | |
git add pdf/${{ github.event.repository.name }}.pdf | |
git commit -m "[GA] update PDF" | |
git push origin main |