11name : Monthly CV Update
2-
32on :
43 schedule :
54 - cron : ' 0 0 1 * *' # Runs at 00:00 UTC on the 1st of each month
65 workflow_dispatch :
7-
86jobs :
97 update-cv :
108 runs-on : ubuntu-latest
119 permissions :
1210 contents : write
13-
1411 steps :
1512 - name : Check out repository
1613 uses : actions/checkout@v4
1714 with :
1815 ref : main
1916 fetch-depth : 0
20-
17+
2118 - name : Set up R
2219 uses : r-lib/actions/setup-r@v2
23-
24- - name : Install R dependencies
20+ with :
21+ use-public-rspm : true
22+
23+ - name : Install system dependencies
2524 run : |
26- Rscript -e 'install.packages(c("rorcid","rcrossref","RefManageR","dplyr","stringr","jsonlite"), repos = "https://cloud.r-project.org")'
27-
25+ sudo apt-get update
26+ sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev
27+
28+ - name : Setup R dependencies
29+ uses : r-lib/actions/setup-r-dependencies@v2
30+ with :
31+ packages : |
32+ any::rorcid
33+ any::rcrossref
34+ any::RefManageR
35+ any::dplyr
36+ any::stringr
37+ any::jsonlite
38+
2839 - name : Refresh publications
2940 run : Rscript update_pubs.R
30-
41+
3142 - name : Set up Typst
3243 uses : typst-community/setup-typst@v4
33-
44+
3445 - name : Install Font Awesome
3546 run : |
3647 sudo apt-get update
3748 sudo apt-get install -y fonts-font-awesome
3849 sudo fc-cache -fv
39-
50+
4051 - name : Compile CV (Typst)
4152 run : typst compile cv/resume.typ
42-
53+
4354 - name : Commit updated CV
4455 run : |
4556 git config --global user.name "github-actions[bot]"
4657 git config --global user.email "github-actions[bot]@users.noreply.github.com"
47-
4858 if git diff --quiet -- cv/resume.pdf cv/resume.typ research/index.qmd 2>/dev/null; then
4959 echo "No changes to CV, skipping commit"
5060 exit 0
5161 fi
52-
5362 git pull --rebase origin main || echo "Pull failed, continuing anyway"
5463 git add cv/resume.pdf cv/resume.typ research/index.qmd
5564 git commit -m "Automated CV update [skip ci]" || echo "No changes to commit"
56-
5765 for i in {1..3}; do
5866 if git push origin HEAD:main; then
5967 echo "Push successful on attempt $i"
6573 fi
6674 done
6775 env :
68- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments