@@ -4,7 +4,7 @@ name: Deploy static content to Pages
44on :
55 # Runs on pushes targeting the default branch
66 push :
7- branches : ["master", "beamer-tutorial-2025 "]
7+ branches : ["master", "main", "6-html-support "]
88
99 # Allows you to run this workflow manually from the Actions tab
1010 workflow_dispatch :
@@ -22,39 +22,45 @@ concurrency:
2222 cancel-in-progress : false
2323
2424jobs :
25- build_pdf : # Job for LaTeX and Beamer PDF compilation
25+ build_assets : # Job for PDF and HTML compilation
2626 runs-on : ubuntu-latest
2727 steps :
2828 - name : Checkout repository
2929 uses : actions/checkout@v4
3030
31- - name : Compile LaTeX (main.tex)
32- uses : xu-cheng/latex-action@v3
33- with :
34- root_file : main.tex
31+ - name : Compile main.tex to PDF
32+ run : |
33+ docker run --rm --user $(id -u):$(id -g) \
34+ -v "${{ github.workspace }}":/workdir \
35+ -w /workdir \
36+ ghcr.io/xu-cheng/texlive-full:latest \
37+ sh -c "latexmk -C main.tex && latexmk -pdf -interaction=nonstopmode -halt-on-error -file-line-error main.tex"
3538
36- - name : Compile Beamer tutorial (beamer-tutorial.tex)
37- uses : xu-cheng/latex-action@v3
38- with :
39- root_file : beamer-tutorial.tex
39+ - name : Compile main.tex to HTML
40+ run : |
41+ docker run --rm --user $(id -u):$(id -g) \
42+ -v "${{ github.workspace }}":/workdir \
43+ -w /workdir \
44+ ghcr.io/xu-cheng/texlive-full:latest \
45+ sh -c "rm -rf main-html && make4ht main.tex 'xhtml,css-in' -d main-html"
4046
41- - name : Upload main PDF artifact
47+ - name : Upload PDF artifact
4248 uses : actions/upload-artifact@v4
4349 with :
44- name : latex- pdf-output
50+ name : pdf-output
4551 path : main.pdf
4652
47- - name : Upload beamer PDF artifact
53+ - name : Upload HTML artifact
4854 uses : actions/upload-artifact@v4
4955 with :
50- name : beamer-pdf -output
51- path : beamer-tutorial.pdf
56+ name : html -output
57+ path : main-html/
5258
5359 # Single deploy job since we're just deploying
5460 deploy :
55- # Only deploy from the protected default branch
56- if : github.ref == 'refs/heads/master'
57- needs : [build_pdf ]
61+ # Only deploy from the protected default branch (support common names)
62+ if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
63+ needs : [build_assets ]
5864 environment :
5965 name : github-pages
6066 url : ${{ steps.deployment.outputs.page_url }}
@@ -66,25 +72,36 @@ jobs:
6672 steps :
6773 - name : Download all artifacts
6874 uses : actions/download-artifact@v4
75+ if : ${{ !env.ACT }}
6976 with :
70- path : artifacts/ # Downloads both latex-pdf-output and beamer-pdf-output
77+ path : artifacts/
7178
7279 - name : Prepare public directory for Pages
80+ if : ${{ !env.ACT }}
7381 run : |
7482 mkdir public
75- # Move PDFs to public/
76- mv artifacts/latex-pdf-output/main.pdf public/
77- mv artifacts/beamer-pdf-output/beamer-tutorial.pdf public/
78- ls -l public
83+ # Move assets to public/
84+ mv artifacts/pdf-output/main.pdf public/
85+ mv artifacts/html-output public/main-html
86+ # Create a simple index page
87+ echo '<html><head><title>ALP Tutorial Artifacts</title></head><body>' > public/index.html
88+ echo '<h1>ALP Tutorial Artifacts</h1><ul>' >> public/index.html
89+ echo '<li><a href="main.pdf">Main PDF</a></li>' >> public/index.html
90+ echo '<li><a href="main-html/main.html">Main HTML</a></li>' >> public/index.html
91+ echo '</ul></body></html>' >> public/index.html
92+ ls -lR public
7993
8094 - name : Setup Pages
95+ if : ${{ !env.ACT }}
8196 uses : actions/configure-pages@v5
8297
8398 - name : Upload Pages artifact
99+ if : ${{ !env.ACT }}
84100 uses : actions/upload-pages-artifact@v3
85101 with :
86102 path : ./public
87103
88104 - name : Deploy to GitHub Pages
105+ if : ${{ !env.ACT }}
89106 id : deployment
90107 uses : actions/deploy-pages@v4
0 commit comments