feat(p10): scaffold the PETRA III coherence-applications beamline, re… #338
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "CONTRIBUTING.md" | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| - ".github/workflows/docs.yml" | |
| - "scripts/stage_docs.py" | |
| - "scripts/mkdocs_hooks.py" | |
| - "scripts/beamline_descriptor.py" | |
| - "scripts/beamline_pages.py" | |
| - "scripts/catalog_descriptor.py" | |
| - "scripts/catalog_pages.py" | |
| - "scripts/site_descriptor.py" | |
| - "scripts/site_pages.py" | |
| - "scripts/architecture_introspect.py" | |
| - "scripts/architecture_pages.py" | |
| - "deployments/**" | |
| - "catalog/**" | |
| - "talks/**" | |
| # The Architecture pages render their factual tables from the code via AST | |
| # introspection, so a BC / aggregate / event / slice change must redeploy docs. | |
| - "apps/api/src/cora/**" | |
| workflow_dispatch: | |
| # Allow only one concurrent deployment, no cancel-in-progress so a | |
| # late deploy still finishes (matches the pages-action recommendation). | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install MkDocs Material and descriptor deps | |
| run: pip install --quiet "mkdocs-material==9.7.6" "pyyaml>=6,<7" "pydantic>=2.13.4,<3" | |
| - name: Stage README and CONTRIBUTING into docs/ | |
| run: python scripts/stage_docs.py | |
| - name: Build site | |
| run: mkdocs build --strict | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: "talks/*/package-lock.json" | |
| - name: Build talks | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| for dir in talks/*/; do | |
| slug=$(basename "$dir") | |
| [ -f "$dir/package.json" ] || continue | |
| echo "::group::Building deck: $slug" | |
| ( | |
| cd "$dir" | |
| npm install --no-audit --no-fund | |
| # Belt-and-suspenders: playwright-chromium's postinstall sometimes | |
| # skips the binary download in CI. Force it before exporting. | |
| npx --yes playwright install chromium | |
| npm run build -- --base "/cora/talks/$slug/" | |
| npm run export || echo "::warning::PDF export failed for $slug; deck will ship without PDF" | |
| ) | |
| mkdir -p "site/talks/$slug" | |
| cp -R "$dir/dist/." "site/talks/$slug/" | |
| if [ -f "$dir/$slug.pdf" ]; then | |
| cp "$dir/$slug.pdf" "site/talks/$slug/$slug.pdf" | |
| fi | |
| echo "::endgroup::" | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: site | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 |