pages/.github/workflows/render-cv.yml
George 55a2685683
Unify jsonresume and RenderCV CVs solutions (#3462)
Fixes #2787 as an alternative to #2969. It was getting too cumbersome to
have 2 different data sources for CV and also a lot of different layout
files, so I decided to unify them all.
Main changes:
- synchronized the information inside RenderCV (`_data/cv.yml`) and
JSONResume (`assets/json/resume.json`)
- unified layout files for CV information
- added the option to set the "data source" in the CV page

---------

Signed-off-by: George Araújo <george.gcac@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-23 12:36:14 -03:00

66 lines
2.2 KiB
YAML

name: Render a CV
on:
push:
branches:
- main
- master
paths:
- "_data/cv.yml"
- "_data/cv.yaml"
- "assets/rendercv/design.yaml"
- "assets/rendercv/design.yml"
- "assets/rendercv/locale.yaml"
- "assets/rendercv/locale.yml"
- "assets/rendercv/settings.yaml"
- "assets/rendercv/settings.yml"
workflow_call:
workflow_dispatch:
permissions:
contents: write
jobs:
rendercv:
name: RenderCV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install RenderCV
run: |
pip install -r requirements.txt
- name: RenderCV
run: |
cv_file=$(find _data -maxdepth 1 -type f \( -name "cv.yaml" -o -name "cv.yml" \))
if [ -z "$cv_file" ]; then
echo "No cv.yml file found!"
exit 1
fi
rendercv_dir=$(find assets -maxdepth 1 -type d -name "rendercv")
if [ -z "$rendercv_dir" ]; then
echo "No RenderCV config directory found!"
exit 1
fi
design=$(find $rendercv_dir -maxdepth 1 -type f \( -name "design.yaml" -o -name "design.yml" \))
locale=$(find $rendercv_dir -maxdepth 1 -type f \( -name "locale.yaml" -o -name "locale.yml" \))
settings=$(find $rendercv_dir -maxdepth 1 -type f \( -name "settings.yaml" -o -name "settings.yml" \))
if [ -z "$design" ] || [ -z "$locale" ] || [ -z "$settings" ]; then
echo "Missing RenderCV config files!"
exit 1
fi
rendercv render $cv_file --design $design --locale-catalog $locale --settings $settings
- name: Upload rendercv_output as an artifact
uses: actions/upload-artifact@v4
with:
name: RenderCV Output
path: assets/rendercv/rendercv_output
- name: Push the changes
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add -A
git commit -m "chore: render the latest CV"
git push