Create master example #8
Workflow file for this run
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: Create master example | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 0 * * *' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
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' |