mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 07:57:19 -05:00
- Add Railway configuration (railway.toml) - Add GitHub Actions workflows - Railway deployment automation - Python/Node.js testing - Health check monitoring - Add GitHub templates (CODEOWNERS, PR template) - Add requirements files if missing - Standardize deployment across all services This ensures consistent deployment patterns across the entire BlackRoad OS infrastructure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
name: Deploy to DigitalOcean Droplet
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
paths:
|
|
- 'droplet-services/**'
|
|
- 'docker-compose.yaml'
|
|
- 'Dockerfile'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Deploy to Droplet via SSH
|
|
uses: appleboy/ssh-action@v1.0.0
|
|
with:
|
|
host: ${{ secrets.DROPLET_IP }}
|
|
username: root
|
|
key: ${{ secrets.DROPLET_SSH_KEY }}
|
|
script: |
|
|
echo "🚀 Deploying to DigitalOcean Droplet..."
|
|
|
|
# Navigate to application directory
|
|
cd /opt/blackroad || exit 1
|
|
|
|
# Pull latest code
|
|
echo "📥 Pulling latest code..."
|
|
git fetch origin
|
|
git reset --hard origin/main
|
|
|
|
# Backup current state
|
|
echo "💾 Creating backup..."
|
|
docker-compose down
|
|
tar -czf backup_$(date +%Y%m%d_%H%M%S).tar.gz . || true
|
|
|
|
# Pull new images
|
|
echo "📦 Pulling Docker images..."
|
|
docker-compose pull
|
|
|
|
# Build and restart services
|
|
echo "🔨 Building and starting services..."
|
|
docker-compose up -d --build
|
|
|
|
# Wait for services to start
|
|
echo "⏳ Waiting for services..."
|
|
sleep 15
|
|
|
|
# Health check
|
|
echo "🏥 Running health checks..."
|
|
docker-compose ps
|
|
|
|
# Test services
|
|
curl -f http://localhost:8000/health || echo "⚠️ Health check failed"
|
|
|
|
echo "✅ Deployment complete!"
|
|
|
|
- name: Verify Deployment
|
|
run: |
|
|
echo "🔍 Verifying deployment..."
|
|
curl -I https://codex.blackroad.io/health || echo "⚠️ External health check failed"
|
|
|
|
- name: Notify on Success
|
|
if: success()
|
|
run: |
|
|
echo "✅ Droplet deployment successful!"
|
|
|
|
- name: Notify on Failure
|
|
if: failure()
|
|
run: |
|
|
echo "❌ Droplet deployment failed!"
|