bachelor_thesis/.github/workflows/latex.yml
2020-06-10 12:16:53 +02:00

57 lines
2.1 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
paths:
- 'latex/**'
- '.github/workflows/latex.yml'
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v1
- name: LaTeX compilation
uses: dante-ev/latex-action@v0.2.0
with:
# The root LaTeX file to be compiled
root_file: document.tex
# The working directory for the latex compiler to be invoked
working_directory: latex
# LaTeX engine to be used
args: -pdflua -latexoption=-file-line-error -latexoption=-interaction=nonstopmode -interaction=nonstopmode --shell-escape
extra_system_packages: python-pygments
- name: Upload the PDF as Artifact
uses: actions/upload-artifact@v1
with:
name: thesis.pdf
path: ./latex/document.pdf
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: rel/${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./latex/document.pdf
asset_name: thesis.pdf
asset_content_type: application/pdf