Skip to content

Commit

Permalink
fix: simplify the prod and demo deployment as synching the logs is un…
Browse files Browse the repository at this point in the history
…necessary, can check version number in prod and view in DO if necessary
  • Loading branch information
adrianmcphee committed Nov 21, 2024
1 parent e2c0e33 commit 0bf138e
Showing 1 changed file with 3 additions and 78 deletions.
81 changes: 3 additions & 78 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,83 +68,8 @@ jobs:
fi
- name: Update the environments
run: |
echo "Updating production environment..."
doctl apps update $PRODUCTION_ID --spec production.yaml
echo "Updating demo environment..."
doctl apps update $DEMO_ID --spec demo.yaml
- name: Wait for production deployment
run: |
echo "Waiting for production deployment to complete..."
TIMEOUT=600 # 10 minutes
START_TIME=$(date +%s)
while true; do
CURRENT_TIME=$(date +%s)
if [ $((CURRENT_TIME - START_TIME)) -gt $TIMEOUT ]; then
echo "Deployment timed out after $TIMEOUT seconds"
exit 1
fi
STATUS=$(doctl apps get $PRODUCTION_ID --format Status --no-header)
if [ "$STATUS" = "running" ]; then
echo "Production deployment complete!"
break
elif [ "$STATUS" = "error" ]; then
echo "Production deployment failed!"
exit 1
fi
echo "Status: $STATUS - waiting 30 seconds..."
sleep 30
done
- name: Wait for demo deployment
run: |
echo "Waiting for demo deployment to complete..."
TIMEOUT=600 # 10 minutes
START_TIME=$(date +%s)
while true; do
CURRENT_TIME=$(date +%s)
if [ $((CURRENT_TIME - START_TIME)) -gt $TIMEOUT ]; then
echo "Demo deployment timed out after $TIMEOUT seconds"
exit 1
fi
STATUS=$(doctl apps get $DEMO_ID --format Status --no-header)
if [ "$STATUS" = "running" ]; then
echo "Demo deployment complete!"
break
elif [ "$STATUS" = "error" ]; then
echo "Demo deployment failed!"
exit 1
fi
echo "Status: $STATUS - waiting 30 seconds..."
sleep 30
done
- name: Check production deployment
run: |
echo "Production worker logs:"
doctl apps logs $PRODUCTION_ID django-q-worker --tail 50
echo "Production platform logs:"
doctl apps logs $PRODUCTION_ID platform --tail 50
- name: Check demo deployment
run: |
echo "Demo worker logs:"
doctl apps logs $DEMO_ID django-q-worker --tail 50
echo "Demo platform logs:"
doctl apps logs $DEMO_ID platform --tail 50
- name: Verify deployments are healthy
run: |
echo "Checking production health..."
PROD_HEALTH=$(doctl apps get $PRODUCTION_ID --format "Spec.HealthCheck.Status" --no-header)
if [ "$PROD_HEALTH" != "healthy" ]; then
echo "Production deployment is not healthy!"
exit 1
fi
echo "Checking demo health..."
DEMO_HEALTH=$(doctl apps get $DEMO_ID --format "Spec.HealthCheck.Status" --no-header)
if [ "$DEMO_HEALTH" != "healthy" ]; then
echo "Demo deployment is not healthy!"
exit 1
fi
echo "All deployments are healthy!"
echo "Deployment updates initiated - please check DigitalOcean console for status"

0 comments on commit 0bf138e

Please sign in to comment.