NNO Docs
Guides

Deploy a Stack

Provision and deploy a stack to production for your NNO platform.

Deploy a Stack to Production

A stack is a named set of Cloudflare resources (Workers, D1 databases, KV namespaces, R2 buckets) provisioned for your platform. Every platform starts with a default stack created automatically during platform bootstrap. You deploy additional stacks to separate environments or isolate workloads.

Prerequisites

Before deploying a stack:

  • Your platform is registered in the NNO Registry (you have a platformId)
  • The platform bootstrap job has completed — check Platform > Provisioning in the NNO Portal
  • You have Wrangler CLI installed and authenticated: wrangler login
  • Your GitHub repository has PACKAGE_READ_TOKEN set in repository secrets for CI builds

Step 1 — Select a stack template

Stack templates define which resources to provision. Browse available templates in the NNO Portal under Stacks > Templates, or list them via the Stack Registry API:

curl https://gateway.svc.nno.app/api/stack-registry/templates \
  -H "Authorization: Bearer <your-api-key>"

Note the templateId of the template you want to use.

Step 2 — Provision the stack

Trigger a BOOTSTRAP_PLATFORM provisioning job from the NNO Portal (Platform > Stacks > New Stack), or via the Provisioning API:

curl -X POST https://gateway.svc.nno.app/api/provisioning/jobs \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "BOOTSTRAP_PLATFORM",
    "platformId": "<platformId>",
    "templateId": "<templateId>",
    "stackId": "production"
  }'

The Provisioning service creates your Cloudflare resources in order and records each resource in the Registry. Provisioning typically takes 2–5 minutes.

Step 3 — Configure environment variables

Once provisioning completes, set the environment-specific variables your console needs:

# apps/console/.env.prod
VITE_APP_ENV=prod
VITE_GATEWAY_URL=https://gateway.svc.nno.app
VITE_AUTH_URL=https://auth.svc.default.<platformId>.nno.app
VITE_PLATFORM_ID=<platformId>

For staging, use .env.stg and point to staging URLs (*.stg.nno.app):

# apps/console/.env.stg
VITE_APP_ENV=stg
VITE_GATEWAY_URL=https://gateway.svc.stg.nno.app
VITE_AUTH_URL=https://auth.svc.stg.default.<platformId>.nno.app
VITE_PLATFORM_ID=<platformId>

Step 4 — Deploy the console

Push to main to trigger a production build, or push to develop for staging:

# Production
git push origin main

# Staging
git push origin develop

The GitHub Actions workflow (deploy.yml) picks up the correct .env file per branch and deploys to the matching Cloudflare Pages project. First builds take 2–3 minutes.

To deploy manually:

# Build for production
pnpm --filter console build --mode prod

# Deploy to Cloudflare Pages
wrangler pages deploy apps/console/dist --project-name nno-<platformId>-console

Step 5 — Verify the deployment

Check that the console is reachable and the auth Worker is responding:

# Console
curl -I https://console.app.default.<platformId>.nno.app
# Expect: HTTP/2 200

# Auth Worker
curl https://auth.svc.default.<platformId>.nno.app/api/auth/session
# Expect: {"session": null}

In the NNO Portal, navigate to Platform > Stacks and confirm all resources show status: active.

Monitoring deployment status

Track provisioning jobs in the NNO Portal under Platform > Provisioning. Each job shows:

  • Current step and overall status (pending, running, completed, failed)
  • Individual resource status (DNS provisioning, SSL certificate state)
  • Error details if a step fails

DNS and SSL certificates activate within 15–30 minutes after provisioning. See DNS Setup for details on certificate provisioning.

Next steps

On this page