add Q-SE'24 tpc #96
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 Github Pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
update_pages: | |
runs-on: ubuntu-latest | |
outputs: | |
cv_pdf_exists: ${{ steps.cv_pdf_exists.outputs.files_exists }} | |
cv_changed: ${{ steps.filter.outputs.cv }} | |
db_changed: ${{ steps.filter.outputs.db }} | |
workflow_changed: ${{ steps.filter.outputs.workflow }} | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: gh-pages | |
- name: Update gh-pages branch | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Shaohan Hu" | |
git reset --hard origin/master | |
git push -f | |
- name: Check if gh-pages root has a cv.pdf | |
id: cv_pdf_exists | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "./cv.pdf" | |
- name: Check cv-related directories for changes | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
cv: | |
- 'cv/**' | |
db: | |
- 'db/**' | |
workflow: | |
- '.github/**' | |
build_cv: | |
needs: update_pages | |
if: | | |
needs.update_pages.outputs.cv_pdf_exists == 'false' || | |
needs.update_pages.outputs.cv_changed == 'true' || | |
needs.update_pages.outputs.db_changed == 'true' || | |
needs.update_pages.outputs.workflow_changed == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Compile cv | |
uses: xu-cheng/latex-action@v2 | |
with: | |
working_directory: cv/ | |
root_file: cv.tex | |
latexmk_use_lualatex: true | |
- name: Check cv.pdf | |
run: | | |
file cv/cv.pdf | grep -q ' PDF ' | |
- name: Update cv.pdf | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Shaohan Hu" | |
git add -f cv/cv.pdf | |
git mv -f cv/cv.pdf ./ | |
git commit -m "deploy cv.pdf" | |
git push | |