Skip to content

Convert Report to PDF #18

Convert Report to PDF

Convert Report to PDF #18

Workflow file for this run

name: Convert Report to PDF
on:
workflow_dispatch:
inputs:
report:
description: 'Report to convert'
required: true
type: choice
# TODO options to be called from a script or code
options:
- Aciclovir-Mean
- Aciclovir-Mean-SVG
- Aciclovir-Population
- Raltegravir-Absorption
- Raltegravir-Mass-Balance
- Test-NO7
- Test-NO8
- Test-NO9
- Test-NO10
- Test-NO11
- Test-NO12
jobs:
report-to-pdf:
runs-on: ubuntu-latest
# Allow only authorized collaborators to trigger GA:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# All steps in workflow:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pandoc and wkhtmltopdf
run: |
sudo apt update
sudo apt install pandoc
- name: Perform html conversion with pandoc
run: |
pandoc -f markdown -t html5 --embed-resources --standalone \
-o Reports/${{ inputs.report }}/Report.html \
Reports/${{ inputs.report }}/Report.md -c osp.css
# Run the HTML to PDF converter action
- name: HTML website to PDF converter
uses: ferdinandkeller/html-to-pdf-action@v2
with:
source-path: "./Reports/${{ inputs.report }}/Report.html"
destination-path: "./Reports/${{ inputs.report }}/Report.pdf"
- name: Save PDF file as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.report }}-pdf
path: Reports/${{ inputs.report }}