Skip to content

Sync Google Doc CV #154

Sync Google Doc CV

Sync Google Doc CV #154

name: Sync Google Doc CV
on:
schedule:
- cron: "0 4 * * *" # daily at 21:00 Mountain (04:00 UTC)
workflow_dispatch:
permissions:
contents: write
jobs:
sync-cv:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Sync CV from Google Docs export
run: |
bash scripts/sync_google_doc_cv.sh
- name: Sync new publications from CV DOIs
run: |
python scripts/sync_publications_from_cv.py
- name: Rebuild publications include from public Google Doc HTML
run: |
python scripts/rebuild_publications_include_from_doc.py
- name: Sync publications HTML from CV
run: |
python scripts/sync_publications_html.py
- name: Commit CV + publication updates when changed
id: commit
run: |
if git diff --quiet; then
echo "No changes to commit."
echo "changed=false" >> $GITHUB_OUTPUT
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets/pdf/enquist_cv.pdf \
assets/cv/google_doc_cv_latest.txt \
assets/cv/google_doc_cv.sha256 \
assets/cv/publications_sync_report.txt \
_data/cv_sync.yml \
_bibliography/papers.bib \
scripts/rebuild_publications_include_from_doc.py \
_includes/publications_full_from_doc.md
git commit -m "chore(cv): sync CV and publications from Google Doc"
# Pull and rebase before push to avoid race conditions
git pull --rebase origin main || {
echo "⚠️ Rebase conflict; aborting push."
exit 1
}
# Push with one retry on transient failure
git push || git push
echo "changed=true" >> $GITHUB_OUTPUT
# Deploy is now triggered automatically on push to main; no manual dispatch needed.