Deployments
Deployments are the process of building and running your application on Deployxa. Each time you push code or trigger a manual deployment, a new deployment is created.
Deployment Lifecycle
Every deployment goes through these stages:
1. Queued
The deployment is waiting to start. This happens when:
- You push code to a connected branch
- You trigger a manual deployment
- A webhook is received from GitHub
Duration: Usually < 5 seconds
2. Building
Deployxa clones your repository and builds your application:
- Clone: Repository is cloned from GitHub
- Detect: Framework and build settings are detected
- Install: Dependencies are installed
- Build: Application is compiled
- Package: Application is packaged into a container
Duration: 30-120 seconds (depends on application size)
3. Deploying
The built container is deployed to the edge network:
- Create Container: Docker container is created
- Configure: Environment variables and domains are configured
- Health Check: Application health is verified
- Route Traffic: Traffic is routed to the new container
Duration: 10-30 seconds
4. Live
Your application is now live and serving traffic:
- HTTPS enabled
- Global CDN active
- Auto-scaling enabled
- Monitoring active
5. Failed (if applicable)
If any stage fails, the deployment is marked as failed:
- Build errors
- Missing dependencies
- Configuration issues
- Resource limits exceeded
Deployment Types
Production Deployments
Production deployments are created when you push to your main branch (usually main or master).
Characteristics:
- Deployed to production environment
- Uses production environment variables
- Serves live traffic
- Custom domains point here
Preview Deployments
Preview deployments are created for pull requests.
Characteristics:
- Unique URL:
pr-123.project.deployxa.app - Isolated environment
- Automatic cleanup when PR closes
- Comment on PR with preview URL
See Preview Deployments for details.
Manual Deployments
You can trigger deployments manually:
From Dashboard:
- Go to Project → Deployments
- Click "New Deployment"
- Select branch
- Click "Deploy"
From CLI:
deployxa deploy
deployxa deploy --branch develop
deployxa deploy --project my-app
From API:
POST /api/projects/{projectId}/deployments
{
"branch": "main"
}
Viewing Deployments
Deployment List
Access via Project → Deployments
Each deployment shows:
- ID: Unique deployment identifier
- Status: Queued, Building, Deploying, Live, Failed
- Commit: Git commit hash and message
- Author: Who triggered the deployment
- Branch: Which branch was deployed
- Duration: How long the deployment took
- Created: When the deployment started
Deployment Details
Click on any deployment to view details:
Overview:
- Status and progress
- Commit information
- Build logs
- Runtime logs
- Resource usage
Actions:
- View Logs: See build and runtime logs
- Rollback: Revert to this deployment
- Promote: Promote preview to production
- Inspect: View container details
Deployment Logs
Build Logs
Build logs show the entire build process:
[2024-01-15 10:30:00] Cloning repository...
[2024-01-15 10:30:05] Repository cloned successfully
[2024-01-15 10:30:06] Detecting framework...
[2024-01-15 10:30:07] Framework detected: Next.js
[2024-01-15 10:30:08] Installing dependencies...
[2024-01-15 10:30:45] Dependencies installed
[2024-01-15 10:30:46] Building application...
[2024-01-15 10:31:30] Build completed
[2024-01-15 10:31:31] Creating container...
[2024-01-15 10:31:45] Container created
[2024-01-15 10:31:46] Deploying to edge network...
[2024-01-15 10:32:00] Deployment successful!
Runtime Logs
Runtime logs show your application's output:
[2024-01-15 10:32:01] Starting application...
[2024-01-15 10:32:02] Listening on port 3000
[2024-01-15 10:32:03] Health check passed
[2024-01-15 10:35:00] GET /api/users 200 15ms
[2024-01-15 10:35:05] POST /api/login 200 42ms
[2024-01-15 10:36:00] Error: Database connection timeout
Accessing Logs
From Dashboard:
- Go to Project → Deployments
- Click on a deployment
- Click "View Logs"
From CLI:
deployxa logs
deployxa logs --deployment abc123
deployxa logs --follow
From API:
GET /api/deployments/{deploymentId}/logs
Rollbacks
Rollbacks allow you to revert to a previous deployment instantly.
When to Rollback
- Production issues discovered
- Bug in new deployment
- Performance degradation
- Configuration error
How to Rollback
From Dashboard:
- Go to Project → Deployments
- Find the deployment to rollback to
- Click "Rollback"
- Confirm rollback
From CLI:
deployxa rollback
deployxa rollback --deployment abc123
From API:
POST /api/deployments/{deploymentId}/rollback
Rollback Process
- Stop Current: Current deployment is stopped
- Start Previous: Previous deployment is started
- Route Traffic: Traffic is routed to previous deployment
- Verify: Health check is performed
Duration: 5-10 seconds
Rollback Limitations
- Can only rollback to successful deployments
- Environment variables from previous deployment are used
- Custom domains remain unchanged
- Rollback creates a new deployment record
Promotions
Promotions allow you to promote a preview deployment to production.
When to Promote
- Preview deployment tested and verified
- Ready to go live
- Stakeholder approval received
How to Promote
From Dashboard:
- Go to Project → Deployments
- Find the preview deployment
- Click "Promote to Production"
- Confirm promotion
From CLI:
deployxa promote --deployment abc123
From API:
POST /api/deployments/{deploymentId}/promote
Promotion Process
- Create Production: New production deployment is created
- Copy Configuration: Environment and settings are copied
- Deploy: Application is deployed to production
- Update Domains: Custom domains are updated
- Verify: Health check is performed
Auto-Deployments
Auto-deployments automatically deploy when you push code.
Configuration
Enable/Disable:
- Go to Project → Settings → General
- Toggle "Auto-deploy on push"
- Save changes
Branch Configuration:
- Deploy only from specific branches
- Ignore certain branches
- Deploy on tags
Webhook Configuration
Deployxa uses GitHub webhooks to trigger auto-deployments:
Events:
push: Triggered on code pushpull_request: Triggered on PR creation/updaterelease: Triggered on release creation
Security:
- Webhook signatures are verified
- Only authorized repositories can trigger deployments
- Webhook secrets are encrypted
Deployment Strategies
Rolling Updates
Default strategy for zero-downtime deployments:
- Start new container
- Wait for health check
- Route traffic to new container
- Stop old container
Benefits:
- Zero downtime
- Instant rollback
- No dropped connections
Blue/Green Deployments
Enterprise feature for critical applications:
- Deploy to "green" environment
- Test green environment
- Switch traffic from "blue" to "green"
- Keep blue as backup
Benefits:
- Instant rollback
- Full testing before go-live
- No risk to production
Canary Deployments
Gradually roll out to a percentage of users:
- Deploy new version
- Route 10% of traffic to new version
- Monitor metrics
- Gradually increase to 100%
Benefits:
- Low risk rollout
- Real-world testing
- Easy rollback
Deployment Performance
Optimization Tips
1. Optimize Build Process
- Use dependency caching
- Minimize build steps
- Use multi-stage Docker builds
2. Optimize Application
- Minimize bundle size
- Use code splitting
- Enable compression
3. Optimize Resources
- Right-size containers
- Use auto-scaling
- Monitor resource usage
Performance Metrics
Track deployment performance:
- Build Time: Time to build application
- Deploy Time: Time to deploy container
- Total Time: End-to-end deployment time
- Success Rate: Percentage of successful deployments
Deployment Limits
Concurrent Deployments
- Free: 1 concurrent deployment
- Pro: 3 concurrent deployments
- Enterprise: Unlimited concurrent deployments
Deployment History
- Free: Last 10 deployments
- Pro: Last 100 deployments
- Enterprise: Unlimited deployment history
Deployment Frequency
No limits on deployment frequency. Deploy as often as needed.
Troubleshooting
Deployment Stuck in Queue
Problem: Deployment shows "Queued" for too long
Solution:
- Check build worker status
- Verify repository access
- Check resource limits
- Contact support if issue persists
Build Failed
Problem: Deployment shows "Build Failed"
Solution:
- Review build logs
- Check for missing dependencies
- Verify build command
- Test build locally
- Check framework detection
Deployment Failed
Problem: Deployment shows "Deploy Failed"
Solution:
- Check container logs
- Verify environment variables
- Check resource limits
- Review health check configuration
Slow Deployments
Problem: Deployments take too long
Solution:
- Optimize build process
- Use dependency caching
- Reduce application size
- Upgrade plan for more resources
Best Practices
Deployment Frequency
- Deploy small changes frequently
- Use feature flags for large changes
- Test in preview before production
- Automate testing in CI/CD
Rollback Strategy
- Keep recent deployments for quick rollback
- Test rollbacks regularly
- Document rollback procedures
- Monitor after rollback
Monitoring
- Set up health checks
- Monitor error rates
- Track deployment metrics
- Configure alerts
Security
- Never commit secrets
- Use environment variables
- Rotate keys regularly
- Audit deployment logs
Related Topics
Need Help? Contact support@deployxa.com or join our community Discord.