Deploy Command
The slipway slide command deploys your Sails application to production. It's the primary way to get your code running.
Basic Usage
cd my-sails-app
slipway slideThis deploys to the default environment (usually production).
Command Aliases
All these commands do the same thing:
slipway slide # Primary - "slide into production"
slipway deploy # Alias
slipway launch # AliasOptions
Environment
Deploy to a specific environment:
# Deploy to staging
slipway slide --env=staging
# Deploy to production (explicit)
slipway slide --env=productionApp
In multi-app environments, target a specific app by slug:
# Deploy the API app
slipway slide --app=api
# Deploy the worker app to staging
slipway slide --env=staging --app=workerIf omitted, the default app in the environment is deployed.
Message
Add a deployment message:
slipway slide --message="Fix login bug"
slipway slide -m "Add new feature"This message appears in deployment history.
Force Rebuild
Ignore Docker cache and rebuild everything:
slipway slide --no-cacheUseful when:
- Dependencies changed but
package-lock.jsondidn't - Build is behaving unexpectedly
- Base image updated
Dry Run
See what would happen without actually deploying:
slipway slide --dry-runOutput:
Dry run - no changes will be made
Would deploy:
Project: my-sails-app
Environment: production
Source: 15 files (2.3 MB)
Dockerfile: ./Dockerfile
Steps:
1. Package source code
2. Upload to server
3. Build Docker image
4. Run health checks
5. Switch traffic
6. Remove old containerVerbose Output
See detailed output:
slipway slide --verboseShows:
- Full Docker build output
- Container logs during startup
- Health check details
Quiet Mode
Minimal output:
slipway slide --quiet
slipway slide -qOnly shows errors and the final URL.
Output
Normal Output
$ slipway slide
Sliding my-sails-app into production
✓ Packaging source (2.3 MB)
✓ Uploading to server
✓ Building image (slipway/myapp:abc123)
✓ Starting container
✓ Health check passed
✓ Updating routes
✓ Deployment successful
Deployment ID: abc123
URL: https://myapp.example.com
Duration: 1m 42sVerbose Output
$ slipway slide --verbose
Sliding my-sails-app into production
▶ Packaging source...
→ Using git archive (respects .gitignore)
→ Files: api/, config/, views/, app.js, Dockerfile, package.json
→ Archive: 2.3 MB
✓ Package created
▶ Uploading to server...
→ Server: https://slipway.example.com
→ Progress: 100%
✓ Upload complete (1.2s)
▶ Building image...
→ docker build -t slipway/myapp:abc123 .
Step 1/8 : FROM node:22-alpine
---> abc123def456
Step 2/8 : WORKDIR /app
---> Using cache
...
Successfully built xyz789
✓ Image built (45s)
▶ Starting container...
→ docker run -d --name myapp-abc123 slipway/myapp:abc123
→ Container ID: container123
✓ Container started
▶ Running health check...
→ GET http://myapp-abc123:1337/health
→ Attempt 1/3: waiting...
→ Attempt 2/3: 200 OK (healthy)
✓ Health check passed (12s)
▶ Switching traffic...
→ Updating Caddy routes
→ myapp.example.com → myapp-abc123:1337
✓ Traffic switched
▶ Cleaning up...
→ Stopping old container myapp-def456
→ Removing old container
✓ Cleanup complete
✓ Deployment successful
Deployment ID: abc123
URL: https://myapp.example.com
Duration: 1m 42sExit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Build failed |
3 | Health check failed |
4 | Upload failed |
5 | Authentication error |
Use in scripts:
slipway slide && echo "Deploy succeeded" || echo "Deploy failed"Environment Variables
Required Configuration
The CLI needs to know your server:
# Option 1: Login (stores credentials)
slipway login
# Option 2: Environment variables
export SLIPWAY_SERVER=https://slipway.example.com
export SLIPWAY_TOKEN=your-api-token
slipway slideCI/CD Example
# .github/workflows/deploy.yml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Slipway CLI
run: npm install -g slipway
- name: Deploy
env:
SLIPWAY_SERVER: ${{ secrets.SLIPWAY_SERVER }}
SLIPWAY_TOKEN: ${{ secrets.SLIPWAY_TOKEN }}
run: slipway slide --message "Deploy from GitHub Actions"Common Workflows
Deploy and Watch Logs
slipway slide && slipway logs myapp -tDeploy with Test First
npm test && slipway slideDeploy to Staging, Then Production
# Deploy to staging
slipway slide --env=staging
# Test staging manually...
# Deploy to production
slipway slide --env=productionRollback on Failure
slipway slide || slipway rollback myappTroubleshooting
"Project Not Found"
slipway slide
# Error: Project not found. Run 'slipway init' first.Solution:
# Check if .slipway.json exists
cat .slipway.json
# If not, initialize
slipway init
# Or link to existing project
slipway link my-project-slug"Not Authenticated"
slipway slide
# Error: Not authenticated. Run 'slipway login' first.Solution:
slipway login"Build Failed"
slipway slide
# Error: Build failed at step 4Solution:
Check build logs:
bashslipway logs myapp --buildTest locally:
bashdocker build -t test .Common fixes:
- Check
package-lock.jsonis committed - Verify Dockerfile syntax
- Check for missing files
- Check
"Health Check Failed"
slipway slide
# Error: Health check failed after 3 attemptsSolution:
Check app logs:
bashslipway logs myappTest health endpoint locally:
bashcurl http://localhost:1337/healthCommon fixes:
- Ensure app starts within timeout
- Check database connections
- Verify environment variables
"Upload Failed"
slipway slide
# Error: Upload failed: connection refusedSolution:
Check server is accessible:
bashcurl https://slipway.example.com/healthCheck your network connection
Verify server URL:
bashslipway whoami
Best Practices
1. Always Use Messages
slipway slide -m "Fix payment processing"Makes deployment history meaningful.
2. Check Status Before Deploying
slipway app:status myapp
slipway slide3. Use --dry-run for Important Deploys
slipway slide --dry-run --env=production
# Review output, then:
slipway slide --env=production4. Script Complex Deployments
#!/bin/bash
# deploy.sh
set -e
echo "Running tests..."
npm test
echo "Deploying to staging..."
slipway slide --env=staging -m "$1"
echo "Waiting for staging to be ready..."
sleep 30
echo "Running smoke tests..."
curl -f https://staging.myapp.example.com/health
echo "Deploying to production..."
slipway slide --env=production -m "$1"
echo "Done!"Usage:
./deploy.sh "New feature release"What's Next?
- View Deployment Logs for debugging
- Set up Rollbacks for quick recovery
- Configure Auto-Deploy for CI/CD