fix typos and g++ command, remove text duplication #27
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
| # Simple workflow for deploying static content to GitHub Pages | |
| name: Deploy static content to Pages | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ["master"] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build_pdf: # New job for PDF compilation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Compile LaTeX to PDF | |
| uses: xu-cheng/latex-action@v3 | |
| with: | |
| root_file: main.tex | |
| - name: Upload PDF artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: latex-pdf-output | |
| path: main.pdf # Assuming main.pdf is in the root after compilation | |
| build_html: # New job for HTML compilation | |
| runs-on: ubuntu-latest | |
| # This entire job will run inside the specified container | |
| container: | |
| image: texlive/texlive:latest # This container has mk4ht | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Note: When using a container, 'actions/checkout' checks out into /github/workspace | |
| # The default working directory for subsequent 'run' commands will be this path. | |
| - name: Compile LaTeX to HTML using tex4ht | |
| # 'mk4ht' is now guaranteed to be available in this container environment | |
| run: | | |
| echo "Starting HTML compilation with mk4ht..." | |
| mk4ht htlatex main.tex "config.cfg,xhtml" "-p" | |
| # Create output directory and move files | |
| mkdir -p html_output | |
| mv main.html html_output/ | |
| # Add commands to move other generated files like .css, image folders etc. | |
| if [ -f main.css ]; then mv main.css html_output/; fi | |
| if [ -d main-images ]; then mv main-images html_output/; fi | |
| echo "HTML compilation complete and files moved to html_output/." | |
| - name: Upload HTML artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: latex-html-output | |
| path: html_output/ | |
| # Single deploy job since we're just deploying | |
| deploy: | |
| needs: [build_pdf, build_html] | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ # Downloads both latex-pdf-output and latex-html-output | |
| - name: Prepare public directory for Pages | |
| run: | | |
| mkdir public | |
| # Move PDF to public/ | |
| mv artifacts/latex-pdf-output/main.pdf public/ | |
| # Move HTML files to public/html/ | |
| mkdir -p public/html | |
| mv artifacts/latex-html-output/* public/html/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./public | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |