Merge branch 'main' of https://github.com/sinaatalay/rendercv-pipeline #12
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 | |
rendercv render $cv_file --pdf-path ../${cv_file%.yaml}.pdf --markdown-path ../README.md --latex-path ../${cv_file%.yaml}.tex | |
cd .. | |
- 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 | |
- name: Upload rendercv_output as an artifact | |
if: steps.changes.outputs.cv == 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RenderCV Output | |
path: rendercv_output |