Skip to content

Commit 9973253

Browse files
committed
update workflow
1 parent 85e0941 commit 9973253

1 file changed

Lines changed: 34 additions & 14 deletions

File tree

.github/workflows/build.yaml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,43 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Setup Pandoc
21-
uses: r-lib/actions/setup-pandoc@v2
22-
23-
- name: Install LaTeX
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18'
24+
25+
- name: Install Puppeteer
2426
run: |
25-
sudo apt-get update
26-
sudo apt-get install -y texlive-latex-base texlive-fonts-recommended texlive-latex-extra
27+
npm install puppeteer
2728
28-
- name: Convert Markdown to PDF
29+
- name: Convert HTML to PDF
2930
run: |
30-
pandoc resume.md -o resume.pdf \
31-
--pdf-engine=pdflatex \
32-
--css=resume-style.css \
33-
--variable geometry:margin=1in \
34-
--variable fontsize=11pt \
35-
--variable linestretch=1.15
36-
31+
node -e "
32+
const puppeteer = require('puppeteer');
33+
(async () => {
34+
const browser = await puppeteer.launch({
35+
headless: true,
36+
args: ['--no-sandbox', '--disable-setuid-sandbox']
37+
});
38+
const page = await browser.newPage();
39+
await page.goto('file://${{ github.workspace }}/resume.html', {
40+
waitUntil: 'networkidle0'
41+
});
42+
await page.pdf({
43+
path: 'resume.pdf',
44+
format: 'A4',
45+
printBackground: true,
46+
margin: {
47+
top: '0.5in',
48+
right: '0.75in',
49+
bottom: '0.5in',
50+
left: '0.75in'
51+
}
52+
});
53+
await browser.close();
54+
})();
55+
"
56+
3757
- name: Upload PDF artifact
3858
uses: actions/upload-artifact@v4
3959
with:

0 commit comments

Comments
 (0)