mirror of
https://github.com/tmaier/asn-qr-code-label-generator.git
synced 2026-03-14 08:33:37 +00:00
Add GitHub workflow for PDF generation using Playwright
Create a workflow that generates a DIN A4 PDF of the print version of index.html and stores it as an artifact. Uses Playwright with Chromium to load the page, wait for QR codes to render, and generate the PDF.
This commit is contained in:
parent
9b596b5506
commit
f58462df32
3 changed files with 90 additions and 0 deletions
37
.github/workflows/generate-pdf.yml
vendored
Normal file
37
.github/workflows/generate-pdf.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Generate PDF Labels
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
generate-pdf:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Install Playwright Chromium
|
||||
run: npx playwright install chromium
|
||||
|
||||
- name: Generate PDF
|
||||
run: npm run generate-pdf
|
||||
|
||||
- name: Upload PDF artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: asn-labels-pdf
|
||||
path: asn-labels.pdf
|
||||
retention-days: 30
|
||||
Loading…
Add table
Add a link
Reference in a new issue