Skip to content

Commit 3393e1a

Browse files
author
Manthan Ankolekar
committed
feat: added generate pdf yml
1 parent a5e2d5a commit 3393e1a

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

.github/workflows/generate-pdf.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
name: Generate PDF
1+
# .github/workflows/convert-to-pdf.yml
22

3+
name: Docs to PDF
4+
# This workflow is triggered on pushes to the repository.
35
on:
46
push:
57
branches:
6-
- main # Change this to your branch name if necessary
8+
- main
9+
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory
10+
paths:
11+
- '**.md'
12+
- 'images/**'
713

814
jobs:
9-
build:
15+
converttopdf:
16+
name: Build PDF
1017
runs-on: ubuntu-latest
11-
1218
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v2
15-
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v2
19+
- uses: actions/checkout@v2
20+
- uses: baileyjm02/markdown-to-pdf@v1
1821
with:
19-
node-version: "14"
20-
21-
- name: Install dependencies
22-
run: npm install puppeteer
23-
24-
- name: Generate PDF
25-
run: |
26-
npx puppeteer print README.md --pdf ./assets/README.pdf
22+
input_dir: docs
23+
output_dir: pdfs
24+
images_dir: docs/images
25+
# for example <img src="./images/file-name.png">
26+
image_import: ./images
27+
# Default is true, can set to false to only get PDF files
28+
build_html: false
29+
- uses: actions/upload-artifact@v1
30+
with:
31+
name: docs
32+
path: pdfs

0 commit comments

Comments
 (0)