Skip to content

edengths master

edengths master #1315

Workflow file for this run

name: edengths master
on:
push:
branches:
- master
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: edengths.tex
args: "-pdfps -file-line-error -halt-on-error -interaction=nonstopmode"
- name: Test for modification
run: |
diff -I "%%*" edengths.ps .diff/edengths.ps && echo "action_state=red" >> $GITHUB_ENV || echo "action_state=green" >> $GITHUB_ENV
- name: Commit PS to master
run: |
cp edengths.ps .diff
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .diff/edengths.ps
git commit -m "Update PS"
if: env.action_state == 'green'
- name: Push changes to master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: env.action_state == 'green'
- name: Commit PDF to gh-pages
run: |
mkdir build
mv edengths.pdf build
git fetch --all
git checkout --track origin/gh-pages
cp build/edengths.pdf .
git add ./edengths.pdf
git commit -m "Update PDF"
if: env.action_state == 'green'
- name: Push changes to gh-pages
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
if: env.action_state == 'green'