Update main.yml #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |