fix val
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m0s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Successful in 36s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
eko
2026-04-05 00:18:48 +07:00
parent 1d63c28356
commit 2d2cb95600

View File

@@ -98,7 +98,7 @@ jobs:
# Check if container is running
sleep 5
if docker ps | grep -q kulakpos_web_staging; then
if docker ps | grep kulakpos_web_staging; then
echo "✅ Staging deployment successful!"
docker logs --tail 20 kulakpos_web_staging
else
@@ -223,7 +223,7 @@ jobs:
sleep 10
# Check if container is running
if docker ps | grep -q kulakpos_web_prod; then
if docker ps | grep kulakpos_web_prod; then
echo "✅ Production deployment successful!"
echo ""
echo "Container status:"
@@ -275,37 +275,39 @@ jobs:
ssh kulakpos_prod << 'EOF'
echo "🔍 Verifying production deployment..."
# Check container health
if docker ps --filter "name=kulakpos_web_prod" --format "{{.Status}}" | grep -q "Up"; then
# Check container status (fixed - removed -q flag)
if docker ps --filter "name=kulakpos_web_prod" --format "{{.Status}}" | grep "Up" > /dev/null 2>&1; then
echo "✅ Container is running"
else
echo "❌ Container is not running"
exit 1
fi
# Check if port 8000 is listening
if ss -tlnp | grep -q ":8000"; then
# Check if port 8000 is listening (with timeout)
if timeout 5 ss -tlnp 2>/dev/null | grep ":8000" 2>/dev/null || netstat -tlnp 2>/dev/null | grep ":8000" 2>/dev/null; then
echo "✅ Application is listening on port 8000"
else
echo "❌ Application is not listening on port 8000"
echo "⚠️ Port 8000 not listening, checking container process..."
docker exec kulakpos_web_prod ps aux | grep php || echo "No PHP process found"
exit 1
fi
# Test application response
HTTP_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" http://localhost:8000)
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "302" ]; then
echo "✅ Application is responding with HTTP $HTTP_CODE"
else
echo "❌ Application returned HTTP $HTTP_CODE"
exit 1
fi
# Test application response (with timeout and retry)
echo "Testing application response..."
for i in 1 2 3 4 5; do
if curl -f -s -o /dev/null -w "%{http_code}" http://localhost:8000 | grep "200\|302"; then
echo "✅ Application is responding"
break
elif [ $i -eq 5 ]; then
echo "❌ Application not responding after 5 attempts"
docker logs --tail 20 kulakpos_web_prod
exit 1
fi
echo "Attempt $i/5 failed, waiting..."
sleep 2
done
# Check if .env is properly mounted
docker exec kulakpos_web_prod test -f /var/www/html/.env && echo "✅ .env file is mounted" || echo "⚠️ .env file not found"
echo ""
echo "🎉 Production deployment verification complete!"
echo "Application is running at: https://prod-test.kulakpos.id"
EOF
- name: Send Deployment Notification