Skip to content

Update main.yml

Update main.yml #22

Workflow file for this run

name: Generate PDF
on:
push:
branches: [ pdf ]
# paths:
# - 'doc/**' # Trigger when docs are updated
jobs:
convert_to_pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install md-to-pdf
run: npm install -g md-to-pdf
- name: Merge Markdown files using -exec
run: |
# Find all markdown files in the doc directory, sort them, and merge using -exec
find doc -type f -name "*.md" | sort | xargs -I {} sh -c 'cat "$@" >> combined-documentation.md' _ {}
- name: Convert Markdown to PDF
run: |
md-to-pdf combined-documentation.md > combined-documentation.pdf
- name: Upload PDF
uses: actions/upload-artifact@v4
with:
name: documentation-pdf
path: combined-documentation.pdf