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