Deploy projects to staging or production environments. Repo-agnostic deployment orchestration using SSH MCP for VPS operations and Cloudflare for DNS/SSL. Reads project configuration from deployments.registry.json.
Deploy any registered project to staging or production environments with full verification.
deployments.registry.json/deploy # Interactive: select project + environment
/deploy staging # Deploy current project to staging
/deploy production # Deploy current project to production
/deploy status # Check deployment status across all projects
/deploy rollback # Rollback last deployment
/deploy --project=tribevibe staging # Deploy specific project
Projects are defined in .claude-toolkit/.claude/skills/infrastructure/deployments.registry.json:
{
"projects": {
"projectname": {
"vps": { "host": "x.x.x.x", "user": "root", "sshKeyName": "key_name" },
"environments": {
"staging": { "domain": "...", "dockerCompose": "..." },
"production": { "domain": "...", "dockerCompose": "..." }
}
}
}
}
# Read registry to get project config
REGISTRY=".claude-toolkit/.claude/skills/infrastructure/deployments.registry.json"
# Detect current project from git remote or CLAUDE.md
PROJECT=$(git remote get-url origin | grep -oP '(?<=/)[^/]+(?=\.git)')
# Verify VPS connectivity
ssh -o ConnectTimeout=5 ${USER}@${HOST} "echo 'VPS accessible'"
# Verify Docker is running
ssh ${USER}@${HOST} "docker info > /dev/null 2>&1"
# Trigger GitHub Actions deployment workflow
gh workflow run deploy-${ENV}.yml --ref ${BRANCH}
# Or build locally and push
docker build -t ${PROJECT}-api:${VERSION} .
docker push ghcr.io/${ORG}/${PROJECT}-api:${VERSION}
# SSH to VPS and deploy
ssh ${USER}@${HOST} << 'DEPLOY'
cd ${DOCKER_COMPOSE_PATH}
# Backup database before deployment
docker exec ${DB_CONTAINER} pg_dump -U postgres ${DB_NAME} > /backup/${PROJECT}_$(date +%Y%m%d_%H%M%S).sql
# Pull latest images
docker compose pull
# Rolling restart (zero-downtime if configured)
docker compose up -d --remove-orphans
# Wait for health checks
sleep 10
docker compose ps
DEPLOY
# Health check
curl -f https://${API_DOMAIN}/health || echo "FAILED"
# Check container status
ssh ${USER}@${HOST} "docker ps --format 'table {{.Names}}\t{{.Status}}'"
# Check recent logs for errors
ssh ${USER}@${HOST} "docker logs ${API_CONTAINER} --tail 50 | grep -i error"
# Rollback to previous image
ssh ${USER}@${HOST} << 'ROLLBACK'
cd ${DOCKER_COMPOSE_PATH}
docker compose down
docker tag ${PROJECT}-api:previous ${PROJECT}-api:latest
docker compose up -d
ROLLBACK
# Or restore database
ssh ${USER}@${HOST} "cat /backup/${PROJECT}_LATEST.sql | docker exec -i ${DB_CONTAINER} psql -U postgres ${DB_NAME}"
This skill uses SSH MCP for secure VPS access:
{
"id": "project-vps",
"command": "npx ssh-mcp",
"args": ["--host=${HOST}", "--user=${USER}", "--key=${SSH_KEY_PATH}"]
}
Tool reference: mcp__project-vps__exec
# Deployment Report
**Project**: ${project}
**Environment**: ${environment}
**Status**: SUCCESS | FAILED | ROLLED_BACK
## Services
| Service | Status | Health |
|---------|--------|--------|
| api | Up 2m | 200 OK |
| web | Up 2m | 200 OK |
| db | Up 5h | Connected |
## Health Checks
- API: https://api.example.com/health - 200 OK (45ms)
- Web: https://example.com - 200 OK (120ms)
## Actions Taken
1. Pulled latest images
2. Backed up database
3. Deployed via docker compose
4. Verified health checks
## Next Steps
- Monitor Seq logs: https://seq.example.com
- Run smoke tests
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer