Update latex.yml #82
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 CV to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up LaTeX environment | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: CV.tex | |
latexmk_use_lualatex: true | |
root: . | |
- name: Commit and Push changes to update-cv branch | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout -b update-cv || git checkout update-cv | |
git add CV.pdf | |
git commit -m "Update CV.pdf" | |
git fetch origin | |
git merge origin/update-cv --no-ff --allow-unrelated-histories -m "Merge remote-tracking branch 'origin/update-cv'" || true | |
git checkout --theirs CV.pdf | |
git checkout --theirs .github/workflows/latex.yml | |
git add CV.pdf .github/workflows/latex.yml | |
git commit -m "Resolve merge conflicts in CV.pdf and workflow file" | |
git push origin update-cv | |
- name: Create a Pull Request to the Private Repository | |
run: | | |
curl -X POST \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Content-Type: application/json" \ | |
-d '{"title": "Update CV Repository", "head": "update-cv", "base": "main", "body": "Automated PR to update CV"}' \ | |
https://api.github.com/repos/nsswifter/AcademicApplicationDocuments/pulls |