diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..6e05e57 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,32 @@ +name: Compile LaTeX + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: docker + container: texlive/texlive + + steps: + - name: Checkout repository + run: | + git clone "$(echo "$GITHUB_SERVER_URL" | sed -E "s#(https?://)#\1${FORGEJO_TOKEN}@#")/${GITHUB_REPOSITORY}.git" . + + - name: Compile LaTeX document + run: | + TMP="$RUNNER_TEMP/output" + cd Aufgabe + latexmk -pdf -interaction=nonstopmode -output-directory="$TMP" main.tex + mv "$TMP/main.pdf" Aufgabe.pdf + + - name: Commit PDF back to repo + run: | + git config --global user.name "Forgejo Runner" + git config --global user.email "runner@localhost" + git add . + git commit -m "Automated PDF build" + git push origin "$GITHUB_REF_NAME"