File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,19 +32,26 @@ jobs:
3232 - name : Checkout
3333 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434 with :
35- ref : ' slides'
35+ ref : slides
3636 - name : Setup Pages
3737 uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
38+ - name : Setup Node
39+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
40+ - name : Generate PDF version
41+ run : |
42+ npm install puppeteer && \
43+ node pdf-export.mjs;
3844 - name : Package files
3945 run : |
4046 mkdir -p slides/images && \
4147 cp index.html slides/ && \
42- cp images/* slides/images/;
48+ cp images/* slides/images/ && \
49+ cp slides.pdf;
4350 - name : Upload artifact
4451 uses : actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4552 with :
4653 # Upload appropriate files
47- path : ' slides'
54+ path : slides
4855 - name : Deploy to GitHub Pages
4956 id : deployment
5057 uses : actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
Original file line number Diff line number Diff line change 1+ import puppeteer from "puppeteer" ;
2+ import * as path from "path" ;
3+
4+ const browser = await puppeteer . launch ( ) ;
5+ const page = await browser . newPage ( ) ;
6+
7+ await page . goto (
8+ path . join ( path . dirname ( import . meta. url ) , "index.html?print-pdf" )
9+ ) ;
10+
11+ await page . pdf ( { path : "slides.pdf" , format : "A4" , timeout : 0 } ) ;
12+
13+ await browser . close ( ) ;
You can’t perform that action at this time.
0 commit comments