whoami/.gitea/workflows/build.yml
2025-09-15 18:28:41 +02:00

47 lines
1.1 KiB
YAML

name: Build CV
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-pdf:
runs-on: ubuntu-latest
container: texlive/texlive:latest
steps:
- uses: xu-cheng/latex-action@v4
with:
root_file: |
file1.tex
file2.tex
- name: Checkout repository
uses: actions/checkout@v4
- name: Upload PDF artifact
uses: actions/upload-artifact@v3
with:
name: curriculum-vitae
path: main.pdf
retention-days: 30
- name: Deploy to pdf-artifacts branch
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
cp main.pdf /tmp
git fetch origin pdf-artifacts
git checkout pdf-artifacts
cp /tmp/main.pdf .
git add main.pdf
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update CV PDF from commit ${{ github.sha }}"
git push origin pdf-artifacts
fi