fix vald
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m2s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Successful in 35s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
eko
2026-04-05 00:57:34 +07:00
parent eafa8d362f
commit 75ece668cc

View File

@@ -231,11 +231,6 @@ jobs:
echo "" echo ""
echo "Container logs (last 20 lines):" echo "Container logs (last 20 lines):"
docker logs --tail 20 kulakpos_web_prod docker logs --tail 20 kulakpos_web_prod
# Test the application locally
echo ""
echo "Testing application locally..."
curl -f http://127.0.0.1:8000 > /dev/null 2>&1 && echo "✅ Application is responding on port 8000" || echo "⚠️ Application not responding on port 8000"
else else
echo "❌ Production deployment failed! Checking logs:" echo "❌ Production deployment failed! Checking logs:"
docker logs kulakpos_web_prod || echo "No logs available" docker logs kulakpos_web_prod || echo "No logs available"
@@ -269,67 +264,3 @@ jobs:
exit 1 exit 1
fi fi
EOF EOF
- name: Verify Production Deployment
run: |
ssh kulakpos_prod << 'EOF'
echo "🔍 Verifying production deployment..."
# 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 (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 "⚠️ 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 (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://127.0.0.1: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
echo "🎉 Production deployment verification complete!"
EOF
- name: Send Deployment Notification
if: always()
run: |
STATUS="${{ job.status }}"
if [ "$STATUS" = "success" ]; then
echo "✅ Production deployment completed successfully!"
echo "🌐 Application is now running at: https://prod-test.kulakpos.id"
echo "🐳 Container name: kulakpos_web_prod"
echo "🔌 Port: 8000 (internal) -> 80/443 (Nginx proxy)"
else
echo "❌ Production deployment failed!"
echo "Please check the logs above for details"
exit 1
fi
cleanup:
runs-on: ubuntu-latest
needs: [deploy-staging, deploy-production]
if: always()
steps:
- name: Cleanup old Docker images on runners
run: |
docker system prune -f --filter "until=24h"