master-thesis/.github/workflows/cd.yaml
2023-05-11 17:44:13 +02:00

56 lines
1.2 KiB
YAML

name: 'CD'
on:
pull_request:
push:
tags:
- 'v*'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: thesis
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
name: Tectonic Cache
with:
path: ~/.cache/Tectonic
key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}
restore-keys: |
${{ runner.os }}-tectonic-
- uses: wtfjoke/setup-tectonic@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tectonic
run: make build
- name: Upload PDFs
uses: actions/upload-artifact@v3
with:
name: PDFs
path: 'thesis/Thesis.pdf'
release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- build
steps:
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'thesis/Thesis.pdf'
token: ${{ secrets.GITHUB_TOKEN }}