Compare commits

...

1 Commits

Author SHA1 Message Date
32b5a0a6d0 Refactor GitHub Actions workflow to install LaTeX dependencies and build document directly, updating artifact upload step
All checks were successful
Build LaTeX Document / build_latex (pull_request) Successful in 1m49s
2025-02-10 00:03:40 +01:00

View File

@@ -6,6 +6,10 @@ on:
pull_request:
branches: [ main ]
env:
TEX_NAME: Tesi.tex
PDF_NAME: Tesi.pdf
jobs:
build_latex:
runs-on: ubuntu-latest
@@ -13,15 +17,29 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v4.2.2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@3.2.0
with:
root_file: Tesi.tex
docker_image: ghcr.io/xu-cheng/texlive-full:20250101
- name: Install MiKTeX
run: |
curl -fsSL https://miktex.org/download/key | tee /usr/share/keyrings/miktex-keyring.asc > /dev/null
echo "deb [signed-by=/usr/share/keyrings/miktex-keyring.asc] https://miktex.org/download/ubuntu jammy universe" | sudo tee /etc/apt/sources.list.d/miktex.list
apt-get update
apt-get install miktex -y
miktexsetup --shared=yes finish
- name: Upload PDF file
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4.6.0
- name: Enable automatic package installation
run: initexmf --set-config-value=[MPM]AutoInstall=yes
- name: Build LaTeX document
run: |
pdflatex -interaction=nonstopmode -halt-on-error ${{ env.TEX_NAME }} || (cat /root/.miktex/texmfs/data/miktex/log/pdflatex.log && exit 1)
- name: Check for PDF artifact
run: file ${{ env.PDF_NAME }} || grep -q ' PDF '
- name: Release PDF artifact
uses: softprops/action-gh-release@v2
with:
name: PDF
path: Tesi.pdf
files: ${{ env.PDF_NAME }}
#token: ${{ secrets.GITHUB_TOKEN }}
tag_name: latest
body: |
PDF document built from LaTeX source.