Become the data-only repo: site and worker move to private nagi-bench-site
The showcase app and the arena backend now live in the private nagi-bench-site repo and deploy to Cloudflare Pages, fetching this repo's models/, outputs/ and cases.json at build time. CI here is a standalone data validation (same rules as before, no build), plus an optional repository_dispatch that triggers an instant site rebuild when SITE_DISPATCH_TOKEN is configured — otherwise the site's 6-hour cron picks new data up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ee081a4e34
commit
664a7115c7
5 files changed
+151
-71
No files matched your search
@@ -2,19 +2,39 @@ name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
working-directory: site
|
||||
- name: Type-check and build
|
||||
run: bun run build
|
||||
working-directory: site
|
||||
- name: Validate contribution data
|
||||
run: bun scripts/validate-data.ts
|
||||
|
||||
trigger-site-rebuild:
|
||||
# The site lives in the private nagi-bench-site repo (Cloudflare Pages).
|
||||
# With SITE_DISPATCH_TOKEN set the rebuild is instant; without it the
|
||||
# site's 6-hour cron picks the new data up anyway.
|
||||
if: github.event_name == 'push'
|
||||
needs: validate
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Dispatch data-updated to nagi-bench-site
|
||||
env:
|
||||
TOKEN: ${{ secrets.SITE_DISPATCH_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "SITE_DISPATCH_TOKEN not set; relying on the site's scheduled rebuild."
|
||||
exit 0
|
||||
fi
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
https://api.github.com/repos/nagi-studio/nagi-bench-site/dispatches \
|
||||
-d '{"event_type":"data-updated"}'
|
||||
@@ -1,46 +0,0 @@
|
||||
name: Deploy site to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
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: oven-sh/setup-bun@v2
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
working-directory: site
|
||||
- name: Build
|
||||
run: bun run build
|
||||
working-directory: site
|
||||
env:
|
||||
# Optional arena backend (see worker/README.md); empty = local-only votes.
|
||||
VITE_ARENA_API: ${{ vars.VITE_ARENA_API }}
|
||||
VITE_TURNSTILE_SITE_KEY: ${{ vars.VITE_TURNSTILE_SITE_KEY }}
|
||||
- uses: actions/configure-pages@v5
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: site/dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
Reference in new issue
Block a user