2023-04-29 20:54:56 +02:00
|
|
|
name: Generate documentation PDF (REUSABLE)
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
VERSION:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
# Prepare
|
|
|
|
- name: Checkout source code
|
2023-10-18 06:15:57 +02:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-04-29 20:54:56 +02:00
|
|
|
- name: Install Python
|
2023-10-02 18:30:17 +02:00
|
|
|
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
|
2023-04-29 20:54:56 +02:00
|
|
|
with:
|
2023-09-06 13:44:45 +02:00
|
|
|
python-version: "3.10"
|
2023-04-29 20:54:56 +02:00
|
|
|
- name: Install doc requirements
|
2023-09-29 17:47:34 +02:00
|
|
|
run: pip install --no-cache-dir --require-hashes -r docs/requirements.txt
|
2023-04-29 20:54:56 +02:00
|
|
|
- name: Install chromium
|
2023-05-02 10:47:42 +02:00
|
|
|
run: sudo apt install chromium-browser
|
2023-04-29 20:54:56 +02:00
|
|
|
- name: Install node
|
2023-10-24 06:30:41 +02:00
|
|
|
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
2023-04-29 20:54:56 +02:00
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- name: Install puppeteer
|
2023-09-29 17:47:34 +02:00
|
|
|
run: cd docs && npm install
|
2023-04-29 20:54:56 +02:00
|
|
|
- name: Run mkdocs serve in background
|
|
|
|
run: mkdocs serve & sleep 10
|
|
|
|
- name: Run pdf script
|
|
|
|
run: node docs/misc/pdf.js http://localhost:8000/print_page/ BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf 'BunkerWeb documentation v${{ inputs.VERSION }}'
|
2023-10-02 18:30:17 +02:00
|
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
2023-04-29 20:54:56 +02:00
|
|
|
with:
|
|
|
|
name: BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
|
|
|
|
path: BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
|