-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.78 KB
/
report-to-pdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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
uses: r-lib/actions/setup-pandoc@v2
- 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: fifsky/html-to-pdf-action@master
with:
htmlFile: ./Reports/${{ inputs.report }}/Report.html
outputFile: ./Reports/${{ inputs.report }}/Report.pdf
pdfOptions: |
'{"format": "A4",
"margin": {"top": "10mm", "left": "10mm", "right": "10mm", "bottom": "10mm"},
"displayHeaderFooter": true,
"footerTemplate": "<span>pageNumber/totalPages</span>"
}'
- name: Save PDF file as artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.report }}-pdf
path: Reports/${{ inputs.report }}