Update main.yml #8
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 and Deploy LaTeX PDF | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: docker://blang/latex:ubuntu | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Compile LaTeX | |
run: pdflatex -interaction=nonstopmode main.tex | |
- name: Upload PDF artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pdf_file | |
path: main.pdf | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: [build] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: pdf_file | |
- name: Set up Git | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
- name: Commit and push changes | |
run: | | |
mv main.pdf docs/ | |
git add docs/main.pdf | |
git commit -m "Update PDF [skip ci]" | |
git push |