fix: drop self-entry; registry.json isn't a knowledge graph #3
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: pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'registry.json' | |
| - 'README.md' | |
| - 'schemas/**' | |
| - 'docs/**' | |
| - '.github/workflows/pages.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Stage site | |
| run: | | |
| mkdir -p _site | |
| cp registry.json _site/ | |
| cp -r schemas _site/ | |
| cp -r docs _site/ | |
| cp README.md _site/README.md | |
| # Pre-render README -> index.html at build time (no client-side JS, | |
| # avoids innerHTML XSS surface) | |
| npx -y marked@14 README.md > _site/_readme.html | |
| cat > _site/index.html <<HTML | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>understand-quickly</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.5.1/github-markdown-light.min.css"> | |
| <style> | |
| body { box-sizing: border-box; min-width: 200px; max-width: 980px; margin: 0 auto; padding: 32px 45px; } | |
| .endpoints { background:#f6f8fa; border:1px solid #d0d7de; border-radius:6px; padding:12px 16px; margin-bottom:24px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 13px; } | |
| .endpoints code { background:transparent; padding:0; } | |
| </style> | |
| </head> | |
| <body class="markdown-body"> | |
| <div class="endpoints"> | |
| <strong>Agent endpoints</strong><br> | |
| <code>GET <a href="./registry.json">./registry.json</a></code> — canonical index<br> | |
| <code>GET <a href="./schemas/">./schemas/</a></code> — JSON Schemas | |
| </div> | |
| HTML | |
| cat _site/_readme.html >> _site/index.html | |
| echo "</body></html>" >> _site/index.html | |
| rm _site/_readme.html | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - id: deploy | |
| uses: actions/deploy-pages@v4 |