Refactoring e documentazione (#7) #27
Workflow file for this run
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: Build LaTeX document | |
# Controls when the action will run. | |
on: | |
push: | |
branches: | |
- relazione-latex | |
- dev | |
workflow_dispatch: | |
jobs: | |
build_latex: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Compile main LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
with: | |
working_directory: relazione | |
root_file: main.tex | |
- name: Check if PDF was created | |
run: | | |
ls -la | |
ls -la relazione | |
if [ -f "relazione/main.pdf" ]; then | |
echo "PDF generated successfully." | |
else | |
echo "PDF generation failed." >&2 | |
exit 1 | |
fi | |
- name: Commit and push pdf | |
run: | | |
cp relazione/main.pdf relazione.pdf | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "actions@github.com" | |
git add relazione.pdf | |
git commit -m "Aggiornata relazione (PDF)" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |