|
39 | 39 | name: latex-pdf-output |
40 | 40 | path: main.pdf # Assuming main.pdf is in the root after compilation |
41 | 41 |
|
| 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 | + |
42 | 74 | # Single deploy job since we're just deploying |
43 | 75 | deploy: |
44 | | - needs: [build_pdf] |
| 76 | + needs: [build_pdf, build_html] |
45 | 77 | environment: |
46 | 78 | name: github-pages |
47 | 79 | url: ${{ steps.deployment.outputs.page_url }} |
|
62 | 94 | # Move PDF to public/ |
63 | 95 | mv artifacts/latex-pdf-output/main.pdf public/ |
64 | 96 | # 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/ |
67 | 99 |
|
68 | 100 | - name: Setup Pages |
69 | 101 | uses: actions/configure-pages@v5 |
|
0 commit comments