Repository navigation
Clarify tutorial #18
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2026 Toon Verstraelen <Toon.Verstraelen@UGent.be> | |
| # SPDX-License-Identifier: CC-BY-4.0 | |
| name: Publish Slides | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| # Fonts used by the UGentish templates. | |
| # (Typst finds them in ~/.local/share/fonts) | |
| # The font files are cached, because the CTAN mirrors are occasionally unreachable. | |
| # Increment the version in the key when the font downloads below change. | |
| - name: Cache fonts | |
| id: fonts-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.local/share/fonts | |
| key: fonts-v1 | |
| - name: Download and install fonts | |
| if: steps.fonts-cache.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p ~/.local/share/fonts | |
| CURL="curl -fsSL --connect-timeout 15 --max-time 120 --retry 5 --retry-delay 5 --retry-all-errors" | |
| $CURL https://github.com/adobe-fonts/source-sans/releases/download/3.052R/TTF-source-sans-3.052R.zip -o source-sans.zip | |
| $CURL "https://github.com/adobe-fonts/source-code-pro/releases/download/2.042R-u/1.062R-i/1.026R-vf/TTF-source-code-pro-2.042R-u_1.062R-i.zip" -o source-code-pro.zip | |
| # The mirrors.ctan.org redirector may pick a broken mirror, so try fixed mirrors too. | |
| for mirror in https://mirrors.ctan.org https://ftp.fau.de/ctan https://mirror.init7.net/ctan https://ctan.math.illinois.edu; do | |
| $CURL "$mirror/fonts/erewhon-math.zip" -o erewhon-math.zip && break | |
| done | |
| test -s erewhon-math.zip | |
| unzip -j -o -q source-sans.zip "TTF/*.ttf" -d ~/.local/share/fonts | |
| unzip -j -o -q source-code-pro.zip "TTF/*.ttf" -d ~/.local/share/fonts | |
| unzip -j -o -q erewhon-math.zip "erewhon-math/*.otf" -d ~/.local/share/fonts | |
| - name: Refresh font cache | |
| run: fc-cache -f | |
| - name: Install Typst 0.15.1 | |
| uses: typst-community/setup-typst@v5 | |
| with: | |
| typst-version: 0.15.1 | |
| # UGentish is not available on Typst Universe (yet), so it is cloned. | |
| # Other packages, such as Animo, are downloaded by Typst from Universe. | |
| # See instructors.md for the same steps on a local machine. | |
| - name: Install UGentish Typst packages | |
| run: | | |
| git clone --depth 1 \ | |
| https://github.com/reproducible-reporting/ugentish.git \ | |
| .typst-packages/ugentish | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Create Python environment with StepUp | |
| run: uv sync | |
| # Only the slides are built here. | |
| # The rendered tutorials in handson/ are committed and need Inkscape to render. | |
| - name: Compile the slides with StepUp | |
| run: uv run stepup build build/slides.pdf build/slides.html | |
| - name: Upload slides artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: slides | |
| path: | | |
| build/slides.pdf | |
| build/slides.html | |
| release: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download slides artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: slides | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: | | |
| slides.pdf | |
| slides.html |