Skip to main content

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:

  1. Clone: Repository is cloned from GitHub
  2. Detect: Framework and build settings are detected
  3. Install: Dependencies are installed
  4. Build: Application is compiled
  5. 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:

  1. Create Container: Docker container is created
  2. Configure: Environment variables and domains are configured
  3. Health Check: Application health is verified
  4. 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:

  1. Go to ProjectDeployments
  2. Click "New Deployment"
  3. Select branch
  4. 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 ProjectDeployments

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:

  1. Go to ProjectDeployments
  2. Click on a deployment
  3. 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:

  1. Go to ProjectDeployments
  2. Find the deployment to rollback to
  3. Click "Rollback"
  4. Confirm rollback

From CLI:

deployxa rollback
deployxa rollback --deployment abc123

From API:

POST /api/deployments/{deploymentId}/rollback

Rollback Process

  1. Stop Current: Current deployment is stopped
  2. Start Previous: Previous deployment is started
  3. Route Traffic: Traffic is routed to previous deployment
  4. 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:

  1. Go to ProjectDeployments
  2. Find the preview deployment
  3. Click "Promote to Production"
  4. Confirm promotion

From CLI:

deployxa promote --deployment abc123

From API:

POST /api/deployments/{deploymentId}/promote

Promotion Process

  1. Create Production: New production deployment is created
  2. Copy Configuration: Environment and settings are copied
  3. Deploy: Application is deployed to production
  4. Update Domains: Custom domains are updated
  5. Verify: Health check is performed

Auto-Deployments

Auto-deployments automatically deploy when you push code.

Configuration

Enable/Disable:

  1. Go to ProjectSettingsGeneral
  2. Toggle "Auto-deploy on push"
  3. 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 push
  • pull_request: Triggered on PR creation/update
  • release: 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:

  1. Start new container
  2. Wait for health check
  3. Route traffic to new container
  4. Stop old container

Benefits:

  • Zero downtime
  • Instant rollback
  • No dropped connections

Blue/Green Deployments

Enterprise feature for critical applications:

  1. Deploy to "green" environment
  2. Test green environment
  3. Switch traffic from "blue" to "green"
  4. 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:

  1. Deploy new version
  2. Route 10% of traffic to new version
  3. Monitor metrics
  4. 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

Need Help? Contact support@deployxa.com or join our community Discord.