-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.25 KB
/
update-cv.yaml
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
name: Update CV from CV-repo
on:
workflow_dispatch:
# schedule:
# - cron: '0 0 * * 1' # Runs every Monday at midnight
jobs:
update-cv:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Hugo Site Repository
uses: actions/checkout@v3
- name: Download Latest CV Release Asset
uses: houqp/[email protected]
with:
repo: 'roumail/cv-data'
token: ${{ secrets.GH_PAT }}
match: 'resume-general-v.*\\.zip'
rename: resume.zip
- name: Place Latest Resume in Static Folder
run: |
unzip resume.zip -d resume
RESUME_NAME=$(ls resume/*.pdf)
RESUME_NAME=${RESUME_NAME##*/}
cp -f "resume/$RESUME_NAME" static/uploads/resume.pdf
- name: Commit and Push CV Update
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add static/uploads/resume.pdf
# Check if there are changes
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m 'Update CV to latest version'
git push
fi