| name | Deploy Light Bot to Production |
| description | Promote staging commit to production and deploy using SSH and Docker Compose. |
Deploy Light Bot to Production
Promote the current staging commit to production and deploy the Light Bot application.
Server Configuration
Staging Server
- SSH Key:
~/.ssh/personal
- SSH Host:
root@rmn.pp.ua
- Project Directory:
services/light-bot-staging
- Service Name:
light-bot-staging
- Docker Compose File:
/root/services/docker-compose.yml
Production Server
- SSH Key:
~/.ssh/personal
- SSH Host:
root@rmn.pp.ua
- Project Directory:
services/light-bot
- Service Name:
light-bot
- Telegram Channels:
@power_po2 (same as staging but without _test suffix)
- Docker Compose File:
/root/services/docker-compose.yml
Task
Execute the deployment process to promote staging to production:
Step 1: Get Staging Commit Hash
Fetch the current git commit hash from the staging server:
ssh -i ~/.ssh/personal root@rmn.pp.ua "cd services/light-bot-staging && git rev-parse HEAD"
Step 2: Fast-Forward Local Prod Branch
- Ensure local repo is clean (warn if there are uncommitted changes)
- Fetch latest changes
- Fast-forward local
prod branch to the staging commit:
git fetch origin
git checkout prod
git merge --ff-only <STAGING_COMMIT_HASH>
If fast-forward fails, stop and ask the user for guidance.
Step 3: Push Prod Branch
Push the updated prod branch to remote (regular push, no force):
git push origin prod
Step 4: Check and Sync Environment Variables
Before deployment, check if there are new environment variables in .env.example (from prod branch) that need to be added to production .env:
- Fetch both files:
.env.example from local prod branch (just updated)
.env from the production server
- Compare them to find any new variables in
.env.example that are missing in .env
- If new variables are found:
- Add them to
.env with the default values from .env.example
- Important: Do NOT modify existing values in
.env - they may be intentionally different
- Note: Ensure
TELEGRAM_CHANNEL_ID and TELEGRAM_SCHEDULE_CHANNEL_ID are set to @power_po2 in production
- Ask the user if unsure about any changes
- If changes were made, upload the updated
.env back to the production server
Step 5: Run Deployment Script
Once prod branch is pushed and .env is synced, run the deployment script:
./.claude/skills/deploy-prod/deploy.sh ~/.ssh/personal root@rmn.pp.ua services/light-bot light-bot
The script will:
- SSH into the production server
- Navigate to project directory
- Checkout and pull prod branch
- Rebuild the Docker image
- Restart the service with docker-compose
Step 6: Return to Main Branch
After deployment, switch back to main branch:
git checkout main