Pular para o conteúdo principal

Deployment Environment

Architecture

Your site runs on Cloudflare Workers with SSR (Server-Side Rendering):

  • Workers — Handle SSR requests and serve the app
  • R2 — Stores static assets (JS, CSS, images)
  • CDN — Cloudflare's global network delivers content fast

Environment variables

In production, environment variables are managed in the Cloudflare Workers dashboard by the Cactus team. The table below lists all variables that can be configured per environment.

:::info Variáveis de build-time BRAND_LANGUAGE e ORIGIN_DOMAIN são definidas automaticamente a partir do repos.yml do front-ops em build-time, durante o processo de CI/CD. Você não precisa configurá-las manualmente no dashboard do Cloudflare. :::

VariableDescriptionConfigurar manualmente?
API_BASE_URLURL base da API de produção✅ Sim
ORIGIN_DOMAINDomínio de produção da sua marca⚙️ Automático (build-time via repos.yml)
BRAND_LANGUAGEIdioma padrão (ex: pt-br)⚙️ Automático (build-time via repos.yml)
BRAND_COUNTRYCódigo ISO do país (ex: BRA)✅ Sim
BRAND_CURRENCYCódigo da moeda (ex: BRL)✅ Sim
BRAND_TIMEZONEFuso horário (ex: America/Sao_Paulo)✅ Sim
CASSINO_MODEModo do cassino: legacy | api_new (default: legacy)✅ Sim
CACHE_PURGE_SECRETSecret para invalidar cache manualmente✅ Sim (secret)
CF_WORKER_KEYKey de autenticação do Worker para o BFF✅ Sim (secret)
TURNSTILE_SITE_KEYSite key do Cloudflare Turnstile (captcha)✅ Sim
RECAPTCHA_SITE_KEYSite key do reCAPTCHA (alternativo ao Turnstile)✅ Sim
SMARTICO_SALT_KEYSalt key do Smartico para hash server-side (secret)✅ Sim (secret)
PLATFORM_CACHE_POLICY_JSONPolicy de cache injetada pelo CI/CD⚙️ Automático (não configurar manualmente)

:::caution Variáveis secretas As variáveis marcadas como (secret) devem ser configuradas via wrangler secret put ou pelo painel do Cloudflare — nunca commitadas no repositório.

Variáveis secretas: SMARTICO_SALT_KEY, CACHE_PURGE_SECRET, CF_WORKER_KEY. :::

:::note PLATFORM_CACHE_POLICY_JSON Esta variável é injetada automaticamente pelo pipeline do front-ops em deploy-time, contendo a policy de cache configurada para seu ambiente. Não configure manualmente — qualquer valor definido no dashboard será sobrescrito pelo CI/CD.

Para testar o sistema de cache localmente, você pode definir o valor no seu .dev.vars ou .env. Consulte a documentação interna para o formato esperado. :::

Build

pnpm build

This generates the production build in the build/ directory.

Deploy process

Deploy is managed via GitHub Actions. Your fork has a deploy.yml workflow that triggers automatically on push to main, or can be triggered manually.

Automatic deploy

Push to main → build → deploy to production.

Manual deploy

Go to ActionsDeployRun workflow:

  • Choose the target environment (production, staging, etc.)
  • Optionally specify a ref (branch, tag, or commit SHA) for a one-time deploy

What happens behind the scenes

  1. Your deploy.yml calls the centralized deploy workflow in front-ops
  2. The workflow validates your repository and environment
  3. Builds your project
  4. Deploys to the correct Cloudflare Worker

You don't need to configure Cloudflare tokens or worker names — this is managed by the Cactus team.

Environments

Each brand can have multiple environments (production, staging, homolog, etc.). Each environment is a separate Cloudflare Worker with its own domain and configuration.

The Cactus team defines which environments are available for your brand. Contact the team to request new environments.