Skip to content

controllo up to date workflow #6

controllo up to date workflow

controllo up to date workflow #6

Workflow file for this run

name: Build LaTeX document latexmk
on:
push:
branches: [ "develop" ]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Install LaTeX and dependencies
run: sudo apt-get update && sudo apt-get install -y
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: latexmk texlive texlive-latex-extra texlive-lang-italian
version: 1.0
- name: Pull latest changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git pull origin develop
- name: Compile LaTeX document
run: ./compile.sh
- name: Check if branch is up to date
id: check_changes
run: |
git fetch
if [ -z "$(git diff origin/develop)" ]; then
echo "::set-output name=up_to_date::true"
else
echo "::set-output name=up_to_date::false"
fi
- name: Add, commit and push changes
if: steps.check_changes.outputs.up_to_date == 'false'
run: |
git add .
git commit -m "Compile PDF [bot]"
git push -f