diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34e4694..f05ab6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,37 @@ -name: Build LaTeX document -on: [push] +name: Build LaTeX Document + +on: + push: + branches: + - master # This will run the action when you push to the main branch + pull_request: + jobs: - build_latex: - runs-on: dind + build: + runs-on: ubuntu-latest + steps: - - name: Set up Git repository - uses: actions/checkout@v4 - - name: Build LaTeX Document + # Checkout the repository containing the LaTeX files + - name: Checkout repository + uses: actions/checkout@v3 + + # Install LaTeX dependencies manually (TexLive and BibTeX) + - name: Install LaTeX run: | - workdirr=${{ github.workspace }} - echo $workdirr - docker run --rm -v "$workdirr:/build" ghcr.io/xu-cheng/texlive-full:latest latexmk -pdf -xelatex -shell-escape /build/src/main.tex - - name: Upload PDF file - uses: actions/upload-artifact@v4 + sudo apt-get update + sudo apt-get install -y texlive-full biber + + # Compile the LaTeX document (first pass) + - name: Compile LaTeX (first pass) + run: | + pdflatex -interaction=nonstopmode -halt-on-error -file-line-error main.tex + bibtex main + pdflatex -interaction=nonstopmode -halt-on-error -file-line-error main.tex + pdflatex -interaction=nonstopmode -halt-on-error -file-line-error main.tex + + # Upload the compiled PDF as an artifact + - name: Upload PDF + uses: actions/upload-artifact@v3 with: - name: PDF - path: src/main.pdf \ No newline at end of file + name: compiled-latex + path: main.pdf \ No newline at end of file