Deploy
Frontend Deploy
Pipeline
Code
Dashboard vs Platform
The dashboard (twin-dashboard-frontend) and platform (twin-platform-frontend) are deployed by separate GitHub Actions workflows. Each has its own S3 bucket and CloudFront distribution.
Environment Variables
Critical: Vite embeds VITE_* environment variables at build time, not runtime. This means:
- Env vars must be available when
vite buildruns in GitHub Actions. - They are baked into the JavaScript bundle.
- Doppler is NOT used for frontend -- frontend uses GitHub Secrets.
GitHub Secrets Setup
For each VITE_* variable, add corresponding GitHub Secrets:
| GitHub Secret | Used As |
|---|---|
PRODUCTION_WALLET_CONNECT_PROJECT_ID | VITE_WALLET_CONNECT_PROJECT_ID |
STAGING_WALLET_CONNECT_PROJECT_ID | VITE_WALLET_CONNECT_PROJECT_ID |
PRODUCTION_API_URL | VITE_API_URL |
STAGING_API_URL | VITE_API_URL |
These are passed in the env: block of the Build step in .github/workflows/deploy.yml.
Staging vs Production
- Staging: Triggered on push to
develop(or manually). UsesSTAGING_*GitHub Secrets. - Production: Triggered on push to
main(or manually). UsesPRODUCTION_*GitHub Secrets.
Each environment has its own S3 bucket, CloudFront distribution, and API URL.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
WalletConnect ProjectNotFound code 3000 | VITE_WALLET_CONNECT_PROJECT_ID missing or "development" in bundle | Add GitHub Secret + pass in deploy.yml env: block, re-deploy |
| Old content after deploy | CloudFront cache not invalidated | Run invalidation manually: aws cloudfront create-invalidation --distribution-id XXXXX --paths "/*" |
| Blank page | Build error or missing env var | Check GHA build logs, verify all VITE_* vars are set |
| API calls failing (CORS) | Wrong VITE_API_URL for the environment | Verify the GitHub Secret matches the correct backend URL |
Last modified on