Skip to content

Add a slide on the rule of zero #144

Add a slide on the rule of zero

Add a slide on the rule of zero #144

name: Publish LaTeX slides
on:
push:
paths:
- 'talk/**'
branches:
- master
jobs:
publish-slides:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ essentials, full ]
steps:
- uses: actions/checkout@v3
- name: Setup essentials course
if: matrix.version == 'essentials'
run: echo '\basictrue' > talk/onlybasics.tex
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: C++Course.tex
latexmk_use_xelatex: true
args: -f -pdf -interaction=nonstopmode -shell-escape
working_directory: talk
extra_system_packages: "py-pygments"
- name: Commit to download repository
run: |
set -x
git clone -b download https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git download
cd download
mkdir -p talk
cp ../talk/C++Course.pdf "talk/C++Course_${{ matrix.version }}.pdf"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -f "talk/C++Course_${{ matrix.version }}.pdf"
if (git diff --quiet) || (git diff --staged --quiet)
then
git commit --amend -m "Update C++Course.pdf"
until git push --force-with-lease origin download; do
git pull --rebase origin download
done
else
echo "No changes to commit"
fi
git push