Skip to content

chore: autogen pdf from md #2

chore: autogen pdf from md

chore: autogen pdf from md #2

Workflow file for this run

name: Convert MD to PDF
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
convert-webpage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
npm install puppeteer
npm install live-server
- name: Start live-server to serve the webpage
run: |
npx live-server docs &
sleep 5
- name: Convert webpage to PDF using puppeteer
run: |
node -e "
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('http://localhost:8080/#', { waitUntil: 'networkidle2' });
await page.pdf({ path: 'docs/slides.pdf', format: 'A4' });
await browser.close();
})();
"
- name: Upload PDF artifact
uses: actions/upload-artifact@v3
with:
name: slides-pdf
path: docs/slides.pdf