Create Melisa_K_Savich_CV.yaml #6
This file contains 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: Render a CV | |
on: | |
push: | |
branches: | |
- main | |
workflow_call: # to make the workflow triggerable from other workflows (release.yaml) | |
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: | | |
cd src | |
cv_file=$(find . -maxdepth 1 -type f -name "*_CV.yaml" | head -n 1) | |
if [ -z "$cv_file" ]; then | |
echo "No RenderCV file found!" | |
exit 1 | |
fi | |
cd .. | |
rendercv render src/$cv_file --pdf-path ${cv_file%.yaml}.pdf --markdown-path README.md --latex-path ${cv_file%.yaml}.tex | |
- name: Upload rendercv_output as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RenderCV Output | |
path: rendercv_output | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
base: HEAD | |
filters: | | |
cv: | |
- '*_CV.tex' | |
- 'README.md' | |
- name: Push the changes | |
if: steps.changes.outputs.cv == 'true' | |
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 "render the latest CV" | |
git push |