Merge pull request #40 from aobolensk/05-toc #94
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: Build | |
on: [push, pull_request] | |
permissions: | |
id-token: write | |
contents: read | |
pages: write | |
jobs: | |
ubuntu-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y ninja-build texlive* | |
- name: Build | |
run: | | |
find . -iname '*.tex' -execdir pdflatex -output-directory $GITHUB_WORKSPACE {} \; || exit 1 | |
find . -iname '*.tex' -execdir pdflatex -output-directory $GITHUB_WORKSPACE {} \; || exit 1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pdf-linux | |
path: '*.pdf' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: html | |
path: '*.html' | |
macos-build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache brew packages | |
uses: actions/cache@v4 | |
with: | |
path: /usr/local/Homebrew | |
key: ${{ runner.os }}-brew-${{ hashFiles('brew.txt') }} | |
restore-keys: | | |
${{ runner.os }}-brew- | |
- name: Setup environment | |
run: | | |
brew install --cask mactex | |
- name: Build | |
run: | | |
eval "$(/usr/libexec/path_helper)" | |
find . -iname '*.tex' -execdir pdflatex -output-directory $GITHUB_WORKSPACE {} \; || exit 1 | |
find . -iname '*.tex' -execdir pdflatex -output-directory $GITHUB_WORKSPACE {} \; || exit 1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pdf-macos | |
path: '*.pdf' | |
deploy-to-github-pages: | |
needs: ubuntu-build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Download PDF artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: pdf-linux | |
path: ./slides | |
- name: Download PDF artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: html | |
path: ./ | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |