From 6432b0e664b8f4a2e2f920f779ccf9658000d731 Mon Sep 17 00:00:00 2001 From: Ayushi <46610680+Ayushi141@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:31:30 +0200 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c5ddb50 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: Github Actions CI to build pdf from tex source. +on: push +jobs: + build: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Set up Git repository + uses: actions/checkout@v2 + + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v3 + with: + root_file: main.tex + args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode + pre_compile: tlmgr update --self && tlmgr update --all + post_compile: latexmk -c && mv main.pdf lecture_notes.pdf + + - name: Check pdf file + run: | + file lecture_notes.pdf | grep -q ' PDF ' + - name: Upload file to repository + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Update lecture notes PDF + file_pattern: lecture_notes.pdf