-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.99 KB
/
latex.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and Deploy CV to GitHub Pages
on:
push:
branches:
- main
pull_request:
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 main branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add CV.pdf
git commit -m "Update CV.pdf"
# Fetch and merge remote changes before pushing
git pull origin main --rebase || echo "Merge failed, proceed with rebase" # Optional: Rebase before merge to avoid conflicts
git push origin main
- name: Set up SSH for GitHub Actions
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Add Remote for Private Repository
run: |
git remote add private-repo [email protected]:nsswifter/AcademicApplicationDocuments.git
- name: Create a Pull Request for private repository
run: |
# Fetch the latest changes from the private repo
git fetch private-repo
# Create a new branch for the changes
git checkout -b update-cv
# Push changes to the private repository
git push private-repo update-cv
# Create the pull request using GitHub's REST API
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"title": "Update CV", "head": "update-cv", "base": "main", "body": "Automated PR to update CV.pdf"}' \
https://api.github.com/repos/nsswifter/AcademicApplicationDocuments/pulls