@@ -22,22 +22,61 @@ concurrency:
2222 cancel-in-progress : false
2323
2424jobs :
25+ build_pdf : # New job for PDF compilation
26+ runs-on : ubuntu-latest
27+ steps :
28+ - name : Checkout repository
29+ uses : actions/checkout@v4
30+
31+ - name : Compile LaTeX to PDF
32+ uses : xu-cheng/latex-action@v3
33+ with :
34+ root_file : main.tex
35+
36+ - name : Upload PDF artifact
37+ uses : actions/upload-artifact@v4
38+ with :
39+ name : latex-pdf-output
40+ path : main.pdf # Assuming main.pdf is in the root after compilation
41+
2542 # Single deploy job since we're just deploying
2643 deploy :
44+ needs : [build_pdf]
2745 environment :
2846 name : github-pages
2947 url : ${{ steps.deployment.outputs.page_url }}
3048 runs-on : ubuntu-latest
49+ permissions :
50+ pages : write
51+ id-token : write
52+
53+ environment :
54+ name : github-pages
55+ url : ${{ steps.deployment.outputs.page_url }}
56+
3157 steps :
32- - name : Checkout
33- uses : actions/checkout@v4
34- - name : Setup Pages
35- uses : actions/configure-pages@v5
36- - name : Upload artifact
37- uses : actions/upload-pages-artifact@v3
38- with :
39- # Upload entire repository
40- path : ' .'
41- - name : Deploy to GitHub Pages
42- id : deployment
43- uses : actions/deploy-pages@v4
58+ - name : Download all artifacts
59+ uses : actions/download-artifact@v4
60+ with :
61+ path : artifacts/ # Downloads both latex-pdf-output and latex-html-output
62+
63+ - name : Prepare public directory for Pages
64+ run : |
65+ mkdir public
66+ # Move PDF to public/
67+ mv artifacts/latex-pdf-output/main.pdf public/
68+ # Move HTML files to public/html/
69+ # mkdir -p public/html
70+ # mv artifacts/latex-html-output/* public/html/
71+
72+ - name : Setup Pages
73+ uses : actions/configure-pages@v5
74+
75+ - name : Upload Pages artifact
76+ uses : actions/upload-pages-artifact@v3
77+ with :
78+ path : ./public
79+
80+ - name : Deploy to GitHub Pages
81+ id : deployment
82+ uses : actions/deploy-pages@v4
0 commit comments