Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 35 additions & 20 deletions .github/workflows/compile-and-push-tex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,48 @@ concurrency:
group: ${{ github.ref }} # Group by branch reference (e.g., 'refs/heads/main')
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
name: Compile LaTeX files
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install LaTeX (pdflatex)
run: sudo apt-get update && sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-science

- name: Compile PDFs
run: cd docs && make

- name: Commit changes
- name: Get changed LaTeX files
id: latex-files
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add .
git commit -m "Add generated PDF files" || echo "No changes to commit"

- name: Push changes
run: |
git push origin $GITHUB_REF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- docs/**/*.tex | xargs)
echo "Changed files: $CHANGED_FILES"
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
CHANGED_FILENAMES=$(for file in $CHANGED_FILES; do basename "$file"; done | xargs)
echo "CHANGED_FILENAMES=$CHANGED_FILENAMES" >> $GITHUB_ENV
FILE_COUNT=$(echo $CHANGED_FILENAMES | wc -w)
if [ $FILE_COUNT -gt 1 ]; then
PLURAL_S='s'
else
PLURAL_S=''
fi
echo "PLURAL_S=$PLURAL_S" >> $GITHUB_ENV
- uses: xu-cheng/texlive-action@v2
name: Compile LaTeX Files
with:
scheme: full
texlive_version: 2024
run: |
apk add make
cd docs
for file in ${{ env.CHANGED_FILES }}; do
dir=$(dirname "$file" | cut -d'/' -f2-)
make -B "$dir/$(basename "$file" .tex).pdf"
done
- name: Commit and push PDFs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Add/Update PDF${{ env.PLURAL_S }} for changed LaTeX file${{ env.PLURAL_S }}: ${{ env.CHANGED_FILENAMES }}'
file_pattern: 'docs/*.pdf'
branch: main
1 change: 1 addition & 0 deletions docs/Design/SoftDetailedDes/MIS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
\usepackage{caption}
\usepackage{fullpage}


\hypersetup{
bookmarks=true, % show bookmarks bar?
colorlinks=true, % false: boxed links; true: colored links
Expand Down