Created workflow to convert checklist markdown to pdf #14
Workflow file for this run
This file contains 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: Outbound Checklists Markdown to PDF | |
# This workflow is triggered on pushes to the repository. | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
# Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory | |
paths: | |
- 'tier*/checklist.md' | |
- 'assets/**' | |
jobs: | |
detect-tier: | |
runs-on: ubuntu-latest | |
outputs: | |
tier: ${{ steps.extract-tier.outputs.tier }} | |
steps: | |
- name: Extract tier from changed files | |
id: extract-tier | |
run: | | |
# Get the list of modified files | |
files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) | |
cat files | |
# Extract tier number from paths that match tier*/checklist.md | |
for file in $files; do | |
if [[ "$file" =~ ^(tier[0-9]+)/checklist.md$ ]]; then | |
echo "Tier matched: ${BASH_REMATCH[1]}" | |
echo "tier=${BASH_REMATCH[1]}" >> $GITHUB_ENV | |
echo "::set-output name=tier::${BASH_REMATCH[1]}" | |
break | |
fi | |
done | |
converttopdf: | |
name: Build PDF | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: baileyjm02/markdown-to-pdf@v1 | |
with: | |
input_path: tier1/checklist.md | |
images_dir: assets | |
image_import: ../assets | |
output_dir: tier1/ | |
# Default is true, can set to false to only get PDF files | |
build_html: false | |
- name: List files in root | |
run: ls -a | |
- name: List files in tier 1 | |
run: ls -a tier1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: checklist-generated | |
path: tier1/checklist.pdf |