Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,22 @@ jobs:
--project ${{ env.PROJECT_ID }} \
--port 3000 \
--allow-unauthenticated

- name: Health check (${{ matrix.region }})
run: |
URL=$(gcloud run services describe ${{ env.SERVICE }} \
--region ${{ matrix.region }} \
--project ${{ env.PROJECT_ID }} \
--format='value(status.url)')
echo "Checking $URL/api/health..."
for i in $(seq 1 10); do
STATUS=$(curl -sf "$URL/api/health" | python3 -c "import sys,json; print(json.load(sys.stdin).get('status',''))" 2>/dev/null)
if [ "$STATUS" = "ok" ]; then
echo "Healthy (attempt $i)"
exit 0
fi
echo " attempt $i: $STATUS"
sleep 5
done
echo "Health check failed after 10 attempts"
exit 1
5 changes: 1 addition & 4 deletions scripts/test-api-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ set -e
PORT=3033

cleanup() {
echo "Cleaning up..."
[ -n "$SERVER_PID" ] && kill $SERVER_PID 2>/dev/null
wait $SERVER_PID 2>/dev/null
echo "Done."
wait $SERVER_PID 2>/dev/null || true
}
trap cleanup EXIT

echo "Starting API server on :$PORT..."
API_PORT=$PORT node api.js 2>/dev/null &
SERVER_PID=$!
SERVER_PID=$!

echo "Waiting for server..."
for i in $(seq 1 15); do
Expand Down
Loading