From 221df795e9f4c59e2e2b9c945f7302ec70cca174 Mon Sep 17 00:00:00 2001 From: Pariksheet Nanda Date: Tue, 19 May 2026 14:52:50 -0400 Subject: [PATCH 1/2] Build slides with luatex for font encoding and native utf-8 support - Build using luatex to workaround the various font encoding errors like this: ! LaTeX Error: Command \textquotedbl unavailable in encoding OT1. - One LaTeX developer, Joseph Wright, recommended defaulting to luatex in 2024: https://en.wikipedia.org/wiki/LuaTeX https://www.texdev.net/2024/11/05/engine-news-from-the-latex-project - In general, I find better package compatiability using luatex and some useful packages are luatex only. If you edit your slides in using Emacs and AUCTeX you can set your TeX-engine to luatex. --- .github/workflows/generate-slides.yaml | 1 + Content/Presentations/modularized/.latexmkrc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-slides.yaml b/.github/workflows/generate-slides.yaml index a953b9f9..828b61d6 100644 --- a/.github/workflows/generate-slides.yaml +++ b/.github/workflows/generate-slides.yaml @@ -27,6 +27,7 @@ jobs: lmodern python3-pygments texlive + texlive-luatex texlive-latex-extra texlive-plain-generic diff --git a/Content/Presentations/modularized/.latexmkrc b/Content/Presentations/modularized/.latexmkrc index 9e4cde37..a2a86044 100644 --- a/Content/Presentations/modularized/.latexmkrc +++ b/Content/Presentations/modularized/.latexmkrc @@ -1,3 +1,3 @@ $pdf_mode = 1; -$pdflatex = 'pdflatex -shell-escape %O -interaction=nonstopmode %S'; +$pdflatex = 'lualatex -shell-escape %O -interaction=nonstopmode %S'; $clean_ext .= "nav snm vrb"; From d09c0913e0d02eb53222f9ba28238c60ada63428 Mon Sep 17 00:00:00 2001 From: Pariksheet Nanda Date: Tue, 19 May 2026 16:57:35 -0400 Subject: [PATCH 2/2] Deploy GitHub Pages - Create a simple website using `tree` of recursively listed PDF files. - Do not build release briefings, because they will be moved to the kokkos/development repository and built there. - Build slides for each branch added to matrix.branch strategy so that branches used for specific workshops can be preserved, as suggested by Christian at the 2026-05-19 education and training working group meeting. - Trigger if the workflow file changes, in addition to the existing trigger logic of source file changes. - Speed up build with parallel make. - Use the latest versions of GitHub Actions to avail of security and maintenance improvements. - Silence most yamllint messages. --- .github/workflows/generate-slides.yaml | 105 ++++++++++++++++++++++--- 1 file changed, 93 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate-slides.yaml b/.github/workflows/generate-slides.yaml index 828b61d6..00da187c 100644 --- a/.github/workflows/generate-slides.yaml +++ b/.github/workflows/generate-slides.yaml @@ -1,26 +1,45 @@ -name: Generate slides from source +--- +name: Generate slides from source for specific branches -on: +on: # yamllint disable-line rule:truthy push: paths: - 'Content/Presentations/**' - - 'Content/ReleaseBriefings/**' + - '.github/workflows/generate-slides.yaml' pull_request: branches: [ "main" ] jobs: + define-matrix: + runs-on: ubuntu-latest + + steps: + - name: Set JSON array of branches for which to generate slides + id: branches + run: > + echo + 'branches=["main"]' + >> "$GITHUB_OUTPUT" + + outputs: + branches: ${{ steps.branches.outputs.branches }} + build: + needs: define-matrix + strategy: matrix: - which: [Presentations, ReleaseBriefings] + branch: ${{ fromJSON(needs.define-matrix.outputs.branches) }} runs-on: ubuntu-latest + env: + DEBIAN_FRONTEND: noninteractive + steps: - name: Install packages run: > sudo apt-get update && - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends make latexmk @@ -32,18 +51,80 @@ jobs: texlive-plain-generic - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v6.0.2 + with: + ref: ${{ matrix.branch }} - name: Build slides run: > - cd Content/${{ matrix.which }} && - make + cd Content/Presentations/modularized/ && + make -j - name: Upload PDFs as artifacts id: deployment - uses: actions/upload-artifact@v4.6.1 + uses: actions/upload-artifact@v7.0.1 with: - name: Slides${{ matrix.which }} + name: ${{ matrix.branch }} path: | - Content/${{ matrix.which }}/release-*.pdf - Content/${{ matrix.which }}/modularized/*.pdf + Content/Presentations/modularized/*.pdf + + deploy: + needs: + - define-matrix + - build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Setup GitHub Pages + uses: actions/configure-pages@v6.0.0 + + - name: Enable gh CLI to download build artifacts + uses: actions/checkout@v6.0.2 + + # For some reason, these next two steps cannot be combined. + - name: Download build artifacts + run: > + mkdir branches/ && + pushd branches/ && + for branch in + $(echo '${{ needs.define-matrix.outputs.branches }}' | jq -r '.[]'); + do + gh run download --name ${branch} --dir ${branch}; + done && + popd + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Using `tree` to recursively list files in an index.html is + # described here: https://stackoverflow.com/a/46383157 + - name: Populate the _site directory + run: | + mkdir _site + cd _site/ + mv ../branches/* . + tree -H '.' \ + --noreport \ + --houtro "" \ + --dirsfirst \ + --charset utf-8 \ + --ignore-case \ + -T 'Kokkos Tutorials' \ + -P '*.pdf' \ + -o index.html + tree -F + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v5.0.0 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5.0.0