mirror of
https://github.com/Anon-Planet/thgtoa.git
synced 2026-05-07 03:54:18 +02:00
206a6ff6b7
Refactored GitHub Actions workflow **Build guide PDF** (`scripts\build_guide_pdf.py`): now builds both light and dark mode PDFs (`export/thgtoa.pdf` and `export/thgtoa-dark.pdf` respectively). Signed-off-by: nopeitsnothing <no@anonymousplanet.org>
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
name: 📖 Build PDF
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- "docs/**"
|
|
- "mkdocs.yml"
|
|
- "scripts/build_guide_pdf.py"
|
|
- ".github/workflows/build-pdf.yml"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "docs/**"
|
|
- "mkdocs.yml"
|
|
- "scripts/build_guide_pdf.py"
|
|
- ".github/workflows/build-pdf.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
pdf:
|
|
name: MkDocs + print to PDF
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Install MkDocs Material
|
|
run: pip install mkdocs-material
|
|
|
|
- name: Install Chromium
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends chromium
|
|
|
|
- name: Build PDF
|
|
env:
|
|
CI: true
|
|
run: python scripts/build_guide_pdf.py --both
|
|
|
|
- name: Upload PDF artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: light-pdf
|
|
path: export/thgtoa.pdf
|
|
archive: false
|
|
if-no-files-found: error
|
|
retention-days: 90
|
|
|
|
- name: Upload PDF artifact (Dark Mode)
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: dark-pdf
|
|
path: export/thgtoa-dark.pdf
|
|
archive: false
|
|
if-no-files-found: error
|
|
retention-days: 90
|