Update ci.yml
Browse files- .github/workflows/ci.yml +13 -2
.github/workflows/ci.yml
CHANGED
|
@@ -90,9 +90,20 @@ jobs:
|
|
| 90 |
- name: Test container health
|
| 91 |
run: |
|
| 92 |
docker run -d --name test-container -p 7860:7860 codelens-env:ci-${{ github.sha }}
|
| 93 |
-
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
docker stop test-container
|
|
|
|
| 96 |
|
| 97 |
# ββ Job 5: Publish (on main push only) ββββββββββββββββββββββββ
|
| 98 |
publish:
|
|
|
|
| 90 |
- name: Test container health
|
| 91 |
run: |
|
| 92 |
docker run -d --name test-container -p 7860:7860 codelens-env:ci-${{ github.sha }}
|
| 93 |
+
# Poll the /health endpoint with retries
|
| 94 |
+
for i in {1..15}; do
|
| 95 |
+
if curl -s -f http://localhost:7860/health > /dev/null; then
|
| 96 |
+
echo "Health check passed!"
|
| 97 |
+
docker stop test-container
|
| 98 |
+
exit 0
|
| 99 |
+
fi
|
| 100 |
+
echo "Waiting for app to start... (retry $i/15)"
|
| 101 |
+
sleep 2
|
| 102 |
+
done
|
| 103 |
+
echo "Health check FAILED. Showing container logs:"
|
| 104 |
+
docker logs test-container
|
| 105 |
docker stop test-container
|
| 106 |
+
exit 1
|
| 107 |
|
| 108 |
# ββ Job 5: Publish (on main push only) ββββββββββββββββββββββββ
|
| 109 |
publish:
|