-
Notifications
You must be signed in to change notification settings - Fork 280
50 lines (42 loc) · 1.35 KB
/
doc-html-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
name: Build PoSpace Doc
on: [workflow_dispatch]
jobs:
html_to_pdf:
name: Generate PDF of PoSpace Doc
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Install python markdown
shell: bash
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install markdown
pip install python-markdown-math
# python -m markdown -x mdx_math --verbose -f proof_of_space.html proof_of_space.md
- name: html to pdf
uses: fifsky/html-to-pdf-action@master
with:
htmlFile: ./documents/proof_of_space.html
outputFile: ./documents/proof_of_space.pdf
pdfOptions: '{"margin": {"top": "1cm", "left": "1cm", "right": "1cm", "bottom": "1cm"}}'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Proof-of-Space-Document
path: ./documents/proof_of_space.pdf