Automatic preview deployments for every pull request
Every pull request to aircast-web or aircast-api automatically gets a preview deployment. No commands needed — just push code.
Comment on any PR to trigger these commands:
| Command | Description | Example |
|---|---|---|
/deploy dev | Create or rebuild preview | Forces a fresh preview build |
/deploy staging | Deploy to staging | Updates staging image tag |
/deploy prod | Deploy to production | Updates production image tag |
/destroy | Tear down preview | Removes preview namespace |
/env set K=V | Set env vars | /env set VITE_DEBUG=true |
/env list | Show env vars | Lists current overrides |
/env clear | Remove all env vars | Resets to defaults + rebuilds |
Simply open a PR — the bot deploys automatically:
You: Open PR #42 with branch feat/new-feature
Bot: Adds preview label, posts comment:
### Preview Deployment
| Name | Status | Preview | Updated |
|------|--------|---------|--------|
| aircast-web | ⏳ Building (logs) | deploying... | abc12345 |
After build completes (~2-3 min):
### Preview Deployment
| Name | Status | Preview | Updated |
|------|--------|---------|--------|
| aircast-web | ✅ Ready (logs) | Visit Preview | abc12345 |
Build complete (2m 34s)
| Step | Status | Duration |
|------|--------|----------|
| Run actions/checkout | ✅ | 3s |
| Install dependencies | ✅ | 45s |
| Run linting | ✅ | 12s |
| Build frontend | ✅ | 1m 15s |
| Build and push Docker image | ✅ | 19s |
You: Comment /env set VITE_PUBLIC_API_HOST=custom.api.com VITE_DEBUG=true
Bot: Reacts with 👍, stores env vars, triggers rebuild:
### Environment Variables Updated
| Variable | Value |
|----------|-------|
| VITE_PUBLIC_API_HOST | custom.api.com |
| VITE_DEBUG | true |
Redeploying preview with new config...
You: Comment /deploy staging
Bot: Reacts with 🚀, deploys PR branch to staging environment
When a build fails, the bot shows the failed step and error output:
### Preview Deployment
| Name | Status | Preview | Updated |
|------|--------|---------|--------|
| aircast-web | ❌ Failed (logs) | — | abc12345 |
Build failed at: Run linting (1m 2s total)
| Step | Status | Duration |
|------|--------|----------|
| Run actions/checkout | ✅ | 3s |
| Install dependencies | ✅ | 45s |
| Run linting | ❌ | 14s |
| Build frontend | ⬜ | — |
Error: src/App.tsx(15,3): error TS2322: Type 'string' is
not assignable to type 'number'.
Each preview environment can have custom env vars that override the defaults:
/env set KEY1=value1 KEY2=value2
Multiple vars in one command. Triggers a rebuild with the new config.
/env list
Shows all custom env vars for this PR's preview.
/env clear
Removes all custom vars and rebuilds with defaults.
/env set VITE_PUBLIC_API_HOST=api.custom.test
/env set VITE_DEV_LOGIN_ENABLED=true
/env set VITE_PUBLIC_SFU_URL=wss://sfu.test
The bot tracks build progress in real-time by polling GitHub Actions workflow steps:
A web dashboard is available at /dashboard (requires GitHub OAuth login):
| App | Preview URL Pattern | Example |
|---|---|---|
| aircast-web | https://pr-{N}.app.dev.aircast.one | pr-117.app.dev.aircast.one |
| aircast-api | https://pr-{N}.api.dev.aircast.one | pr-25.api.dev.aircast.one |
| aircast-website | https://pr-{N}.www.dev.aircast.one | pr-5.www.dev.aircast.one |
| aircast-sfu | https://pr-{N}.sfu.dev.aircast.one | pr-3.sfu.dev.aircast.one |
| Status | Meaning | What to do |
|---|---|---|
| ⏳ Building | Source repo is building Docker image | Wait ~3 min for build to complete |
| 🔨 Building (with progress) | Build in progress with step details | Expand to see which step is running |
| 🔄 Deployed, syncing... | Image built, ArgoCD syncing | Wait ~30s for ArgoCD to sync |
| ✅ Ready | Preview is live and health-checked | Click "Visit Preview" |
| ⚠️ Deployed (not responding) | Health check timed out (90s) | Try again in a moment, check pod logs |
| ❌ Failed | Build or deploy failed | Click "logs" link, check error output |
| ⚪ Cancelled | Build cancelled (newer push) | New build auto-started for latest commit |
| 🗑️ Destroyed | Preview cleaned up | Use /deploy dev to recreate |
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/ | GET | — | This documentation page |
/health | GET | — | Health check (returns "ok") |
/metrics | GET | — | Prometheus metrics |
/dashboard | GET | GitHub OAuth | Deployment management UI |
/api/github/webhook | POST | Webhook signature | GitHub webhook receiver |
/api/deploy/complete | POST | Bearer token | Deploy completion callback |
Installed on all aircast-one repositories. Auto-deploy enabled for:
Other repos receive webhook events but won't auto-deploy previews (no ApplicationSet configured).