Skip to content

Commit e318cfd

Browse files
authored
Create deploy_html_pdf.yml
1 parent 6804868 commit e318cfd

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build and Deploy LaTeX Document
2+
3+
permissions: write-all
4+
5+
on:
6+
push:
7+
branches: ["main"]
8+
pull_request:
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
# Restore the TeX Live installation from cache
20+
- name: Restore TeX Live Cache
21+
uses: actions/cache@v2
22+
with:
23+
path: |
24+
/usr/local/texlive
25+
key: texlive-${{ runner.os }}-${{ hashFiles('**/*.tex') }}
26+
27+
- name: Install TeX Live
28+
run: |
29+
sudo apt update
30+
sudo apt install texlive-full
31+
32+
- name: Build Latex PDF and HTML
33+
run: |
34+
mkdir ./public
35+
cp *.tex public/
36+
cp -r assets/ public/
37+
cd public/
38+
pdflatex ElaboracionMemoriaTFG.tex
39+
pdflatex ElaboracionMemoriaTFG.tex
40+
make4ht ElaboracionMemoriaTFG.tex
41+
mv ElaboracionMemoriaTFG.html index.html
42+
43+
# Save the TeX Live installation to cache for future use
44+
- name: Save TeX Live Cache
45+
uses: actions/cache@v2
46+
with:
47+
path: |
48+
/usr/local/texlive
49+
key: texlive-${{ runner.os }}-${{ hashFiles('**/*.tex') }}
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: PDF
55+
path: public/ElaboracionMemoriaTFG.pdf
56+
57+
- name: Publish PDF
58+
uses: softprops/action-gh-release@v1
59+
with:
60+
tag_name: Current
61+
files: public/ElaboracionMemoriaTFG.pdf
62+
63+
- name: Publish HTML to GitHub Pages
64+
uses: peaceiris/actions-gh-pages@v3
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
publish_dir: ./public

0 commit comments

Comments
 (0)