Merge pull request #93 from abakus-ntnu/update-github-actions #53
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: Statutter CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install packages | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qq \ | |
texlive texlive-font-utils \ | |
texlive-lang-european \ | |
texlive-latex-extra \ | |
latexmk \ | |
ghostscript | |
# Need pandoc 2.9.* for compatibility with pandoc-section-links | |
- name: Install pandoc | |
run: | | |
curl -L https://github.com/jgm/pandoc/releases/download/2.9.2.1/pandoc-2.9.2.1-1-amd64.deb -o pandoc.deb | |
sudo dpkg -i pandoc.deb | |
mkdir -p ~/.local/bin | |
export PATH=$HOME/.local/bin:$PATH | |
curl -L "https://github.com/LudvigHz/pandoc-section-links/releases/download/v0.1.0/pandoc-section-links-0.1.0-linux-amd64.tar.gz" | tar xz -C ~/.local/bin | |
- name: Test | |
run: make test | |
- name: Upload build | |
if: github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-files | |
path: gh-pages | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Collect build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-files | |
path: gh-pages | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages | |
enable_jekyll: true |