PDFs #248
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
name: PDFs | |
on: | |
push: | |
branches: [master] | |
paths: | |
- dune-basics/doc/beamer/** | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: "0 14 * * 5" | |
# workflow_dispatch: | |
jobs: | |
build_latex: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Partial Clone | |
shell: bash | |
run: | | |
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | |
git config --global user.email github-actions@github.com | |
git config --global user.name github-actions | |
git clone -q --filter=blob:none --no-checkout --depth=1 --sparse $REPO . | |
git sparse-checkout init --cone | |
git sparse-checkout set dune-basics | |
git checkout | |
- uses: addnab/docker-run-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
registry: ghcr.io | |
image: ghcr.io/cpp-review-dune/introductory-review/dunebasics:latest | |
options: -v ${{github.workspace}}:/work | |
shell: bash | |
run: | | |
sudo chown -R 33333:33333 /work | |
cd /work/ | |
# https://wiki.archlinux.org/title/TeX_Live#texmf_trees_and_Kpathsea export TEXMFHOME=/foo:$TEXMFHOME | |
cmake -S dune-basics -B build | |
cmake --build build | |
ls -lR build/doc/beamer/ | |
- name: Check pdf files | |
run: | | |
find build/doc/beamer/ -type f -name "*.pdf" -exec file -- {} + | grep -q ' PDF ' | |
- name: "Tar files" | |
run: | | |
sudo chown runner:docker -R . | |
mkdir -p docs/public | |
find build/doc/beamer/ -type f -name "*.pdf" -exec mv -i {} docs/public \; | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/public |