ArshVerma commited on
Commit
7b1eaf8
Β·
1 Parent(s): f3e1732

Update ci.yml

Browse files
Files changed (1) hide show
  1. .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
- sleep 10
94
- curl -f http://localhost:7860/health
 
 
 
 
 
 
 
 
 
 
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: