Skip to content

Documentation

Documentation #9

Workflow file for this run

name: Documentation
on:
push:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yml'
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install mkdocs-material
- name: Build documentation
run: mkdocs build --strict
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/
# Generate screenshots for PR preview
- name: Install Playwright
if: github.event_name == 'pull_request'
run: npx playwright install --with-deps chromium
- name: Capture screenshots
if: github.event_name == 'pull_request'
run: |
# Start local server in background
python -m http.server 8000 -d site &
SERVER_PID=$!
sleep 2
mkdir -p screenshots
# Capture each page
for page in \
"index.html:01-home" \
"getting-started/index.html:02-getting-started" \
"interface-overview/index.html:03-interface-overview" \
"ica-tab-guide/index.html:04-ica-tab-guide" \
"classification-workflow/index.html:05-classification-workflow" \
"qc-tab-guide/index.html:06-qc-tab-guide" \
"troubleshooting/index.html:07-troubleshooting"
do
URL_PATH="${page%%:*}"
NAME="${page##*:}"
npx playwright screenshot \
--viewport-size="1280,720" \
--full-page \
"http://localhost:8000/${URL_PATH}" \
"screenshots/${NAME}.png"
done
kill $SERVER_PID
- name: Upload screenshots
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: docs-screenshots
path: screenshots/
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4