Skip to content

Merge pull request #2 from Alexrp02/specify-text-format #17

Merge pull request #2 from Alexrp02/specify-text-format

Merge pull request #2 from Alexrp02/specify-text-format #17

# source inspired by: https://www.zonca.dev/posts/2023-02-02-github-overleaf
# TODO: Improve html with https://docs.github.com/es/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll
name: Build and Deploy LaTeX Document
permissions: write-all
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
# Restore the TeX Live installation from cache
- name: Restore TeX Live Cache
uses: actions/cache@v3
with:
path: |
/usr/local/texlive
key: texlive-${{ runner.os }}-${{ hashFiles('**/*.tex') }}
- name: Install TeX Live
run: |
sudo apt update
sudo apt install texlive-full
- name: Build Latex PDF
run: |
mkdir ./public
cp *.tex public/
cp -r images/ public/
cd public/
pdflatex ElaboracionMemoriaTFG.tex
pdflatex ElaboracionMemoriaTFG.tex
make4ht ElaboracionMemoriaTFG.tex
mv ElaboracionMemoriaTFG.html index.html
# Save the TeX Live installation to cache for future use
- name: Save TeX Live Cache
uses: actions/cache@v3
with:
path: |
/usr/local/texlive
key: texlive-${{ runner.os }}-${{ hashFiles('**/*.tex') }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: PDF
path: public/ElaboracionMemoriaTFG.pdf
- name: Publish PDF
uses: softprops/action-gh-release@v1
with:
tag_name: ÚltimaCompilación
files: public/ElaboracionMemoriaTFG.pdf
- name: Publish HTML to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public