lift push

Build and deploy your application to the server with automatic rollback, health checks, and preview deployments.

lift push

Build and deploy your application to the server. Automatically detects the build method (Compose, Dockerfile, or Nixpacks), uploads code via git archive, builds on the server, performs health checks, and rolls back on failure.

Deployment Flow

  1. Pre-flight checks (Dockerfile lint, .dockerignore, etc.)
  2. Upload code via git archive | ssh tar -x
  3. Detect build method (compose.yml > Dockerfile > Nixpacks)
  4. Shift previous images for rollback history (prev1 through prev5)
  5. Build new Docker image
  6. Stop old containers, start new ones
  7. Run HTTP health check
  8. Auto-rollback on health check failure
  9. Prune old images

Options

FlagDescriptionDefault
-b, --branch <branch>Branch to deploycurrent branch
--no-buildSkip the build step and restart with the existing image
--skip-restartBuild the image but do not restart containers
-f, --forceForce full rebuild, skip Docker build cache
--stop [branch]Stop a preview deployment. Uses current branch if no value given
--listList all active preview deployments with their ports and ages

Production Deploy Example

$ lift push
Deploying my-api to production (branch: main)
3 commit(s) since last deploy:
  abc1234 fix: handle edge case in auth
  def5678 feat: add user avatar upload
  ghi9012 chore: update dependencies
 Code uploaded
 Rollback history updated
Building with Dockerfile...
 Build complete
 1 container(s) started
 All 1 replica(s) healthy (HTTP 200)
 Cleanup complete
 Deployed my-api@abc1234 with 1 replica(s)
Live at: https://api.example.com
  SSL: enabled | Rate limit: 100 req/s

Preview Deploy Example

# Deploy a feature branch as a preview
$ git checkout feat/new-dashboard
$ lift push
Deploying my-api as preview (branch: feat/new-dashboard)
 Code uploaded
 Build complete
 Preview container started
 Deployed my-api@abc1234 (preview: feat/new-dashboard)
Live at: http://168.119.60.42:3142
Container: my-api-preview-feat-new-dashboard
Stop preview: lift push --stop feat/new-dashboard

# List active previews
$ lift push --list
Preview deployments for my-api:
  feat-new-dashboard  port:3142  (2h ago)  Up 2 hours
  fix-login-bug       port:3118  (8d ago - consider stopping)  Up 8 days

# Stop a preview
$ lift push --stop feat/new-dashboard
 Stopped preview for branch: feat/new-dashboard
  • lift init -- Initialize before your first push
  • lift env -- Configure environment variables
  • lift hook -- Auto-deploy on every git push