1- name : Update CV with Citation Badges
1+ name : Deploy CV
22
3- on :
4- push :
5- branches : [main, master]
3+ on :
4+ push :
5+ branches : [main, master]
6+ paths :
7+ - ' _site/cv/**'
68 workflow_dispatch :
79
810permissions :
9- contents : write
11+ contents : read
12+ pages : write
13+ id-token : write
1014
11- jobs :
12- update-cv :
13- runs-on : ubuntu-latest
14-
15- steps :
16- - name : Checkout repository
17- uses : actions/checkout@v4
18- with :
19- token : ${{ secrets. GITHUB_TOKEN }}
20- persist-credentials : true # ADD THIS
21- fetch-depth : 0 # ADD THIS
22-
23- - name : Download CV from Google Drive
24- run : |
25- FILE_ID="1bB2WnhJIigiq-S9CmZNKPpmEYytFz98U"
26- curl -L "https://drive.google.com/uc?export=download&id=${FILE_ID}" -o cv_source.docx
27-
28- - name : Set up R
29- uses : r-lib/actions/setup-r@v2
30- with :
31- r-version : ' 4.3.0'
32-
33- - name : Install system dependencies
34- run : |
35- sudo apt-get update
36- sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libfontconfig1-dev libfreetype6-dev
37-
38- - name : Install R packages
39- run : |
40- install.packages(c("httr", "jsonlite", "officer", "xml2"), repos = "https://cloud.r-project.org")
41- shell : Rscript {0}
42-
43- - name : Process CV with citation badges
44- env :
45- SERPAPI_KEY : ${{ secrets.SERPAPI_KEY }}
46- run : |
47- Rscript process_cv.R cv_source.docx ${{ github.workspace }}/cv_with_badges.docx
48- echo "Checking output:"
49- ls -la ${{ github.workspace }}/cv_with_badges.docx || echo "Not in workspace"
50- ls -la cv_with_badges.docx || echo "Not in current dir"
51- ls -la /tmp/*.docx 2>/dev/null || echo "Not in tmp"
52-
53- - name : Install Java (for LibreOffice)
54- run : |
55- sudo apt-get install -y default-jre
56-
57- - name : Install LibreOffice
58- run : |
59- sudo apt-get install -y libreoffice-writer
60-
61- - name : Convert to PDF
62- run : |
63- echo "📄 Converting to PDF..."
64- echo "Files in directory:"
65- ls -la
66-
67- # Convert using full path
68- libreoffice --headless --convert-to pdf --outdir . cv_with_badges.docx
69-
70- echo "After conversion:"
71- ls -la *.pdf || echo "No PDF found"
72-
73- # Create output directory and move files
74- mkdir -p _site/cv
75-
76- if [ -f "cv_with_badges.pdf" ]; then
77- mv cv_with_badges.pdf _site/cv/cv.pdf
78- mv cv_with_badges.docx _site/cv/cv.docx
79- echo "✅ PDF created successfully"
80- else
81- echo "❌ PDF conversion failed, copying docx only"
82- cp cv_with_badges.docx _site/cv/cv.docx
83- exit 1
84- fi
85-
86- - name : Commit updated CV
87- run : |
88- git config --local user.email "github-actions[bot]@users.noreply.github.com"
89- git config --local user.name "github-actions[bot]"
90- git add _site/cv/
91- git diff --staged --quiet || git commit -m "Update CV with latest citations [skip ci]"
92- git push
15+ # This workflow doesn't need to do anything special -
16+ # Quarto/GitHub Pages will automatically serve files in _site/
17+ # Just make sure _site/cv/ is committed with your cv. pdf and cv.docx
0 commit comments