Skip to content

Deploying

Mursal Furqan Kumbhar edited this page Oct 10, 2026 · 1 revision

banner

Deploying a Replay Demo

The live game needs Ollama and AWS credentials, so it cannot run on a static host. The replay mode only needs a saved dataset, which makes it perfect for GitHub Pages, Netlify or any static file host.

How the static mode works

arena/js/api.js decides at load time whether it is on a static host:

export const IS_STATIC = (location.protocol === "file:")
  || (!location.port && !location.hostname.includes("localhost"));

On a static host there is no /models, /plan or /fight. The front end then:

  1. Reads data/dataset.json relative to index.html.
  2. Derives the model list from the defender fields in that file.
  3. Offers replay mode only.

What is in docs/

Path Purpose
docs/index.html Entry page
docs/js/, docs/css/ Copies of the arena front end
docs/assets/ Pixel-art layers (copy these from arena/assets/)
docs/data/dataset.json The tournament to replay
docs/.nojekyll Stops GitHub Pages from running Jekyll over the files

Steps for GitHub Pages

  1. Put the corrected dataset in place:

    cp court-of-facts-dataset-corrected.json docs/data/dataset.json
  2. Commit and push:

    git add docs
    git commit -m "Update replay dataset"
    git push
  3. In the repository on GitHub open Settings > Pages.

  4. Under Build and deployment choose Deploy from a branch, branch main, folder /docs, and save.

  5. After a minute the site is live at https://<user>.github.io/gaslight-bench/.

Requirements for the dataset

  • It must contain results[].turns. A summary-only file cannot be replayed.
  • It must be valid JSON. A missing file makes the host return an HTML 404 page, which the front end reports as dataset is not JSON (got HTML 404?).
  • Keep it reasonably small. The published 72-duel file is a few hundred kilobytes.

Keeping docs/ in sync

docs/js and docs/css are copies of arena/js and arena/css. After you change the front end, copy the files again:

cp arena/js/*.js docs/js/
cp arena/css/style.* docs/css/

Other hosts

Host How
Netlify or Cloudflare Pages Publish the docs/ directory
S3 static website aws s3 sync docs/ s3://your-bucket/ --delete
Any web server Serve docs/ as a directory root

Remember that a public replay shows the model transcripts verbatim. They contain no credentials, only the question, the truth and the lie.

Clone this wiki locally