updates #33
This file contains hidden or 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: Quarto Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st day of every month | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: 'release' | |
| use-public-rspm: true | |
| - name: Install R Dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| cache-version: 2 | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Set up Typst | |
| uses: typst-community/setup-typst@v4 | |
| - name: Install Font Awesome | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fonts-font-awesome | |
| sudo fc-cache -fv | |
| - name: Compile CV (Typst) | |
| run: typst compile cv/resume.typ | |
| - name: Commit updated CV | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| # Check if there are any changes to commit | |
| if git diff --quiet cv/resume.pdf 2>/dev/null; then | |
| echo "No changes to CV, skipping commit" | |
| exit 0 | |
| fi | |
| # Pull latest changes first to avoid conflicts | |
| git pull --rebase origin main || echo "Pull failed, continuing anyway" | |
| # Add and commit changes | |
| git add cv/resume.pdf | |
| git commit -m "Automated CV update [skip ci]" || echo "No changes to commit" | |
| # Push with retry logic | |
| for i in {1..3}; do | |
| if git push; then | |
| echo "Push successful on attempt $i" | |
| break | |
| else | |
| echo "Push failed on attempt $i, retrying..." | |
| git pull --rebase origin main || echo "Rebase failed" | |
| sleep 2 | |
| fi | |
| done | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Render and Publish | |
| uses: quarto-dev/quarto-actions/publish@v2 | |
| with: | |
| target: gh-pages | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |