-
Notifications
You must be signed in to change notification settings - Fork 282
48 lines (40 loc) · 1.42 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
name: Build PoSpace Doc
on: [workflow_dispatch]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
jobs:
html_to_pdf:
name: Generate PDF of PoSpace Doc
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
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/[email protected]
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@v4
with:
name: Proof-of-Space-Document
path: ./documents/proof_of_space.pdf