finish q6. a very good question for integration practice and hyperbol… #77
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: CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build PDF and Webpage | |
| steps: | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@v4 | |
| - name: Install TeX Live | |
| id: install-tex-live | |
| run: | | |
| sudo apt update | |
| sudo apt install -y texlive-latex-extra texlive-fonts-extra texlive-extra-utils | |
| - name: Install TeX Extras | |
| id: install-tex-extras | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: | | |
| latexmk | |
| execute_install_scripts: true | |
| - name: Create Output Folder | |
| id: create-output-folder | |
| run: | | |
| mkdir -p pdf/tex | |
| - name: Compile PDF File | |
| id: compile-pdflatex | |
| run: latexmk -pdflatex -interaction=nonstopmode -file-line-error -output-directory=pdf -jobname=latest main.tex | |
| - name: Upload PDF file | |
| id: upload-pdf | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PDF | |
| path: pdf/latest.pdf | |
| - name: Set up Python | |
| id: setup-python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| - name: Install Dependencies | |
| id: install-dependencies | |
| run: pip install -r src/requirements.txt | |
| - name: Split Up PDF Files | |
| id: split-pdf | |
| run: | | |
| python3 src/split-pdf.py -o pdf/years -l 1 pdf/latest.pdf | |
| python3 src/split-pdf.py -o pdf/papers -l 2 pdf/latest.pdf | |
| python3 src/split-pdf.py -o pdf/questions -l 3 pdf/latest.pdf | |
| - name: Index Generated Files | |
| id: index-generated-files | |
| run: | | |
| cd pdf | |
| (cd years && tree -I "*.html" -H '.' -s -D --filesfirst -T "STEP Project: PDF By Years (PDF)" -o "index.html") | |
| (cd papers && tree -I "*.html" -H '.' -s -D --filesfirst -T "STEP Project: PDF By Papers (PDF)" -o "index.html") | |
| (cd questions && tree -I "*.html" -H '.' -s -D --filesfirst -T "STEP Project: PDF By Questions (PDF)" -o "index.html") | |
| tree -I "*.html" -H '.' -s -D --filesfirst -T "STEP Project: All Generated Files (PDF)" -o "index.html" | |
| cd .. | |
| - name: Compile Webpage File | |
| id: compile-make4ht | |
| run: make4ht -a info -u -d webpage -j index -c config.cfg main.tex | |
| continue-on-error: true | |
| - name: Create Webpage Folder | |
| id: create-webpage-folder | |
| run: | | |
| cp pdf/latest.pdf webpage/latest.pdf | |
| mkdir -p webpage/generated/ | |
| cp -R pdf webpage/generated/ | |
| - name: Upload static files as artifact | |
| id: upload-webpage | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: webpage/ | |
| deploy-pages: | |
| name: Deploy GitHub Pages | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy-page.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deploy-page | |
| uses: actions/deploy-pages@v4 |