Update Resume #94
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: Update Resume | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Git config | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Fetch and reset hard to origin on a PR | |
run: | | |
git fetch origin ${{ github.event.pull_request.head.ref }} | |
git reset --hard origin/${{ github.event.pull_request.head.ref }} | |
- name: Build Resume | |
run: | | |
# Cloning via PAT | |
git clone https://${{ secrets.ACCESS_TOKEN }}@github.com/cschindlbeck/cv.git | |
cd cv | |
./latexdockercmd.sh pdflatex resume_cschindlbeck.tex | |
cd .. | |
cp cv/resume_cschindlbeck.pdf assets/docs/resume_cschindlbeck.pdf | |
rm -rf cv | |
- name: Add and commit | |
run: | | |
git add assets/docs/resume_cschindlbeck.pdf | |
# Prevent empty add to result in error | |
git diff-index --quiet HEAD || git commit -m "Updated Resume" | |
- if: ${{ github.event_name == 'pull_request' }} | |
name: Push HEAD to PR branch | |
run: | | |
git push origin HEAD:${{ github.event.pull_request.head.ref }} | |
- if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
name: Push on push or schedule | |
run: | | |
git push |