feat: comprehensive content improvements across all chapters (EN + ZH) #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Compile LaTeX and Update PDFs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - '**.tex' | |
| - 'figures/**' | |
| - 'figures_zh/**' | |
| - 'sections_zh/**' | |
| - 'include/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Compile English PDF (pdflatex) | |
| uses: xu-cheng/latex-action@v3 | |
| with: | |
| root_file: main.tex | |
| latexmk_use_pdflatex: true | |
| args: -pdf -interaction=nonstopmode -file-line-error | |
| - name: Compile Chinese PDF (xelatex) | |
| uses: xu-cheng/latex-action@v3 | |
| with: | |
| root_file: main_zh.tex | |
| latexmk_use_xelatex: true | |
| args: -xelatex -interaction=nonstopmode -file-line-error | |
| - name: Copy PDFs to build/ and docs/ | |
| run: | | |
| cp main.pdf build/Control_Theory_Note.pdf | |
| cp main.pdf docs/Control_Theory_Note.pdf | |
| cp main_zh.pdf build/Control_Theory_Note_cn.pdf | |
| cp main_zh.pdf docs/Control_Theory_Note_cn.pdf | |
| - name: Commit and push updated PDFs | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add build/*.pdf docs/*.pdf | |
| if git diff --cached --quiet; then | |
| echo "No PDF changes to commit" | |
| else | |
| git commit -m "ci: auto-compile and update PDFs" | |
| git push | |
| fi |