Skip to content

Commit

Permalink
chore: Update GitHub workflow to convert README to PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanank committed Aug 10, 2024
1 parent 0fd45a7 commit f5e0978
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/convert-to-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# .github/workflows/convert-to-pdf.yml

name: Docs to PDF
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- main
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory or the README.md file
paths:
- 'docs/**.md'
- 'docs/images/**'
- 'README.md'

jobs:
converttopdf:
name: Build PDF
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: baileyjm02/markdown-to-pdf@v1
with:
input_dir: docs
output_dir: pdfs
images_dir: docs/images
# for example <img src="./images/file-name.png">
image_import: ./images
# Default is true, can set to false to only get PDF files
build_html: false
- name: Convert README.md to PDF
run: |
mkdir -p pdfs
npx markdown-pdf README.md -o pdfs/README.pdf
- uses: actions/upload-artifact@v3
with:
name: docs
path: pdfs

0 comments on commit f5e0978

Please sign in to comment.