Skip to content

Docs

Docs #2645

Workflow file for this run

name: Docs
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
merge_group:
jobs:
build-docs-pdf:
runs-on: ubuntu-latest
name: Build PDF docs
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- run: just install
- name: Cache ImageMagick
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-imagemagick
- name: Install ImageMagick and documentation fonts
env:
FONT_BASE: https://github.com/chrissimpkins/codeface/raw/master/fonts/code-new-roman
OUTFIT_BASE: https://github.com/Outfitio/Outfit-Fonts/raw/main/fonts/ttf
FIRA_MATH_URL: https://github.com/firamath/firamath/releases/download/v0.3.4/FiraMath-Regular.otf
run: |
sudo apt-get update -y
sudo apt-get install -y imagemagick fonts-inter
mkdir -p /tmp/qpdk-fonts
curl -fsSL "$OUTFIT_BASE/Outfit-Regular.ttf" -o /tmp/qpdk-fonts/Outfit-Regular.ttf
curl -fsSL "$OUTFIT_BASE/Outfit-Bold.ttf" -o /tmp/qpdk-fonts/Outfit-Bold.ttf
curl -fsSL "$FONT_BASE/Code%20New%20Roman-Regular.otf" -o /tmp/qpdk-fonts/CNR-Regular.otf
curl -fsSL "$FONT_BASE/Code%20New%20Roman-Bold.otf" -o /tmp/qpdk-fonts/CNR-Bold.otf
curl -fsSL "$FONT_BASE/Code%20New%20Roman-Italic.otf" -o /tmp/qpdk-fonts/CNR-Italic.otf
curl -fsSL "$FIRA_MATH_URL" -o /tmp/qpdk-fonts/FiraMath-Regular.otf
sudo mkdir -p /usr/local/share/fonts/qpdk
find /tmp/qpdk-fonts -type f \( -name '*.ttf' -o -name '*.otf' \) -exec sudo cp {} /usr/local/share/fonts/qpdk/ \;
sudo fc-cache -f && rm -rf /tmp/qpdk-fonts
# Allow ImageMagick to convert SVG files (disabled by default in policy)
if [ -f /etc/ImageMagick-6/policy.xml ]; then
sudo sed -i 's/rights="none" pattern="SVG"/rights="read|write" pattern="SVG"/' /etc/ImageMagick-6/policy.xml
fi
- name: Generate LaTeX files
run: just docs-latex || echo "LaTeX build completed with warnings, continuing…"
- name: Compile LaTeX document
continue-on-error: true
uses: xu-cheng/latex-action@6549dc21effb2730855a1281407ecfcececc6c1b # 4.1.0
env:
XINDYOPTS: "-L english -C utf8 -M sphinx.xdy"
with:
texlive_version: latest
os: alpine
pre_compile: cd docs/_build/latex
extra_system_packages: "ghostscript"
root_file: qpdk.tex
compiler: latexmk
continue_on_error: true
latexmk_use_xelatex: true
args: -pdfxe -xelatex -interaction=nonstopmode -f -file-line-error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pdf-docs
path: "./docs/_build/latex/qpdk.pdf"
pages:
permissions:
actions: read
pages: write
id-token: write
uses: doplaydo/pdk-ci-workflow-public/.github/workflows/pages.yml@main # zizmor: ignore[unpinned-uses, secrets-inherit]
secrets:
GFP_API_KEY: ${{ secrets.GFP_API_KEY }}
SIMCLOUD_APIKEY: ${{ secrets.SIMCLOUD_APIKEY }}
deploy-docs:
needs: [build-docs-pdf, pages]
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
actions: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download Pages artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: github-pages
path: combined_tmp
- name: Extract and combine
run: |
mkdir -p combined
tar -xf combined_tmp/artifact.tar -C combined
- name: Download PDF docs
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pdf-docs
path: combined
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
name: github-pages-with-pdf
path: combined
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
with:
artifact_name: github-pages-with-pdf