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
- Pre-flight checks (Dockerfile lint, .dockerignore, etc.)
- Upload code via
git archive | ssh tar -x - Detect build method (compose.yml > Dockerfile > Nixpacks)
- Shift previous images for rollback history (prev1 through prev5)
- Build new Docker image
- Stop old containers, start new ones
- Run HTTP health check
- Auto-rollback on health check failure
- Prune old images
Options
| Flag | Description | Default |
|---|---|---|
-b, --branch <branch> | Branch to deploy | current branch |
--no-build | Skip the build step and restart with the existing image | |
--skip-restart | Build the image but do not restart containers | |
-f, --force | Force full rebuild, skip Docker build cache | |
--stop [branch] | Stop a preview deployment. Uses current branch if no value given | |
--list | List 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