Skip to content

Commit d223649

Browse files
author
Denis Jelovina
committed
initial tex file
1 parent bff3c35 commit d223649

File tree

2 files changed

+92
-12
lines changed

2 files changed

+92
-12
lines changed

.github/workflows/static.yml

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,61 @@ concurrency:
2222
cancel-in-progress: false
2323

2424
jobs:
25+
build_pdf: # New job for PDF compilation
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Compile LaTeX to PDF
32+
uses: xu-cheng/latex-action@v3
33+
with:
34+
root_file: main.tex
35+
36+
- name: Upload PDF artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: latex-pdf-output
40+
path: main.pdf # Assuming main.pdf is in the root after compilation
41+
2542
# Single deploy job since we're just deploying
2643
deploy:
44+
needs: [build_pdf]
2745
environment:
2846
name: github-pages
2947
url: ${{ steps.deployment.outputs.page_url }}
3048
runs-on: ubuntu-latest
49+
permissions:
50+
pages: write
51+
id-token: write
52+
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
3157
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
38-
with:
39-
# Upload entire repository
40-
path: '.'
41-
- name: Deploy to GitHub Pages
42-
id: deployment
43-
uses: actions/deploy-pages@v4
58+
- name: Download all artifacts
59+
uses: actions/download-artifact@v4
60+
with:
61+
path: artifacts/ # Downloads both latex-pdf-output and latex-html-output
62+
63+
- name: Prepare public directory for Pages
64+
run: |
65+
mkdir public
66+
# Move PDF to public/
67+
mv artifacts/latex-pdf-output/main.pdf public/
68+
# Move HTML files to public/html/
69+
# mkdir -p public/html
70+
# mv artifacts/latex-html-output/* public/html/
71+
72+
- name: Setup Pages
73+
uses: actions/configure-pages@v5
74+
75+
- name: Upload Pages artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: ./public
79+
80+
- name: Deploy to GitHub Pages
81+
id: deployment
82+
uses: actions/deploy-pages@v4

main.tex

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
\documentclass{article}
2+
\usepackage[utf8]{inputenc}
3+
\usepackage{hyperref} % For clickable links in PDF
4+
5+
\title{My First LaTeX Document for GitHub Pages}
6+
\author{Your Name}
7+
\date{\today} % Displays the current date
8+
9+
\begin{document}
10+
11+
\maketitle
12+
13+
\section*{Welcome to My GitHub Pages LaTeX Project!}
14+
15+
This document was compiled from \LaTeX{} source code using GitHub Actions and deployed to GitHub Pages.
16+
17+
\subsection*{About This Project}
18+
This is a simple demonstration to show how to publish a \LaTeX{} PDF online.
19+
You can use this setup for:
20+
\begin{itemize}
21+
\item Resumes and CVs
22+
\item Academic papers
23+
\item Reports
24+
\item Personal notes and documentation
25+
\end{itemize}
26+
27+
\subsection*{Links}
28+
\begin{itemize}
29+
\item You can find the source code for this project on \href{https://github.com/YourGitHubUsername/YourRepositoryName}{my GitHub repository}.
30+
\item Learn more about \LaTeX{} at \href{https://www.latex-project.org/}{The \LaTeX{} Project}.
31+
\item Learn more about GitHub Pages at \href{https://docs.github.com/en/pages}{GitHub Docs}.
32+
\end{itemize}
33+
34+
\subsection*{Contact}
35+
Feel free to reach out to me via email: \href{mailto:[email protected]}{[email protected]}.
36+
37+
\vfill % Pushes content to the top
38+
\centering
39+
\small This document was generated on \today.
40+
41+
\end{document}

0 commit comments

Comments
 (0)