Skip to content

Deploying your docs site

InfoEmu static hosting gives you two ways in: upload a built site (you build wherever you like — locally, in CI — and upload the rendered files), or send raw Markdown (POST /api/deploy/{id}/source, or a connected GitHub repo) and InfoEmu builds it for you in an isolated sandbox. Either way, every deploy becomes an immutable release that goes live atomically, and you can roll back at any time.

In your dashboard, open your static/docs site and create a deploy token. Tokens look like:

dpl_<id>.<secret>

The full token is shown once — store it in your CI secret store immediately. Each token is scoped to exactly one site; a token for site A can never deploy to site B. You can revoke a token and mint a new one at any time.

Terminal window
pnpm install
pnpm build

This renders the site into dist/.

This starter ships a deploy.sh at the repo root:

Terminal window
DEPLOY_URL=https://portal.infoemu.com \
INSTANCE_ID=<your-site-id> \
DEPLOY_TOKEN=dpl_... \
./deploy.sh

The script tars dist/ and posts it to the deploy API. Add --dry-run to see exactly what would be uploaded (and the request that would be made) without deploying.

If you’d rather call the API directly (for example from CI), it is three endpoints, all authenticated with Authorization: Bearer <deploy token>:

Terminal window
tar -czf site.tar.gz -C dist .
curl -sS -X POST \
-H "Authorization: Bearer $DEPLOY_TOKEN" \
-F "archive=@site.tar.gz" \
"$DEPLOY_URL/api/deploy/$INSTANCE_ID"
# → 201 {"instance_id": "...", "release": "20260707T120000Z-ab12cd34", "files": 42}

The archive must contain your site files at its root (index.html, not dist/index.html) as regular files — symlinks and special files are rejected. Limits: 200 MiB compressed upload, 512 MiB uncompressed, 50,000 files.

Terminal window
curl -sS -H "Authorization: Bearer $DEPLOY_TOKEN" \
"$DEPLOY_URL/api/deploy/$INSTANCE_ID/releases"

Shows the releases kept on disk and which one is currently live.

Terminal window
curl -sS -X POST -H "Authorization: Bearer $DEPLOY_TOKEN" \
"$DEPLOY_URL/api/deploy/$INSTANCE_ID/rollback"

Atomically re-points the live site at the previous release (or answers 409 if there is no previous release yet). deploy.sh --rollback wraps this call.

  • 401 — missing, revoked, or wrong token. Mint a new token from the dashboard. See Deploy returns 401.
  • 400 “Invalid upload” — the archive contains symlinks, absolute paths, or .. traversal; ship plain files only.
  • 404 — the INSTANCE_ID in the URL doesn’t match the site your token belongs to.
  • 409 — the site isn’t ready to receive deploys yet, or (on rollback) there’s no previous release.
  • 413 — the compressed upload exceeds 200 MiB.