Skip to content

Commit 524fa58

Browse files
author
Denis Jelovina
committed
build html
1 parent 792306f commit 524fa58

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

.github/workflows/static.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,41 @@ jobs:
3939
name: latex-pdf-output
4040
path: main.pdf # Assuming main.pdf is in the root after compilation
4141

42+
build_html: # New job for HTML compilation
43+
runs-on: ubuntu-latest
44+
# This entire job will run inside the specified container
45+
container:
46+
image: texlive/texlive:latest # This container has mk4ht
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
# Note: When using a container, 'actions/checkout' checks out into /github/workspace
52+
# The default working directory for subsequent 'run' commands will be this path.
53+
54+
- name: Compile LaTeX to HTML using tex4ht
55+
# 'mk4ht' is now guaranteed to be available in this container environment
56+
run: |
57+
echo "Starting HTML compilation with mk4ht..."
58+
mk4ht htlatex main.tex "xhtml" "-p"
59+
60+
# Create output directory and move files
61+
mkdir -p html_output
62+
mv main.html html_output/
63+
# Add commands to move other generated files like .css, image folders etc.
64+
if [ -f main.css ]; then mv main.css html_output/; fi
65+
if [ -d main-images ]; then mv main-images html_output/; fi
66+
echo "HTML compilation complete and files moved to html_output/."
67+
68+
- name: Upload HTML artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: latex-html-output
72+
path: html_output/
73+
4274
# Single deploy job since we're just deploying
4375
deploy:
44-
needs: [build_pdf]
76+
needs: [build_pdf, build_html]
4577
environment:
4678
name: github-pages
4779
url: ${{ steps.deployment.outputs.page_url }}
@@ -62,8 +94,8 @@ jobs:
6294
# Move PDF to public/
6395
mv artifacts/latex-pdf-output/main.pdf public/
6496
# Move HTML files to public/html/
65-
# mkdir -p public/html
66-
# mv artifacts/latex-html-output/* public/html/
97+
mkdir -p public/html
98+
mv artifacts/latex-html-output/* public/html/
6799
68100
- name: Setup Pages
69101
uses: actions/configure-pages@v5

0 commit comments

Comments
 (0)