From 5558ebcb1649adeb9a5978f130fb3be988354455 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 14 Nov 2026 01:34:56 -0800 Subject: [PATCH] Add a GitHub Pages workflow for the browser demo --- .github/workflows/pages.yml | 38 +++++++++++++++++++++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..8ea6085 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,38 @@ +name: Publish the browser demo + +on: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + deploy: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + - uses: actions/configure-pages@v5 + id: pages + - run: npm ci + - run: npm run build -- --base "$PAGES_BASE_PATH/" + env: + PAGES_BASE_PATH: ${{ steps.pages.outputs.base_path }} + - uses: actions/upload-pages-artifact@v3 + with: + path: dist + - uses: actions/deploy-pages@v4 + id: deployment diff --git a/README.md b/README.md index 62974ec..5b55204 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,12 @@ Open http://127.0.0.1:5173. The app starts in **practice mode**: a built-in play Your key stays on the local server and never reaches the browser. Don't put keys in variables that start with `VITE_`. Each learning session has a spending limit (`BATCH_BUDGET_USD`, $1 by default), but the costs shown are estimates, not your provider's bill. The example model is a Contributor model, which means Meta may use your prompts and responses for training. The other settings are explained in [.env.example](.env.example). +## Publish a browser demo + +GitHub Pages can host the built app in practice mode. Visitors can try the 2048 tutorial, explore the classroom and past results, and run local exams. The site uses browser storage and needs no Meta API key. + +After merging the workflow, a repository admin can set **Settings → Pages → Build and deployment → Source** to **GitHub Actions**. Then run **Publish the browser demo** from `main` in the Actions tab. The deploy job links to the published site. Run the workflow again to publish updates. + ## The app’s pages - **Classroom:** run a learning session and watch the students, the teacher and the conversation.