Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit 7d2cd6d

Browse files
committed
fix: Properly wait for DB in Actions
1 parent 04b130b commit 7d2cd6d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,18 @@ jobs:
4343
- name: Install deps
4444
run: npm ci
4545

46+
- name: Install PostgreSQL client
47+
run: sudo apt-get update && sudo apt-get install -y postgresql-client
48+
4649
- name: Wait for database
47-
run: npx prisma db wait --schema prisma/schema.prisma --timeout 30
50+
run: |
51+
for i in {1..30}; do
52+
PGPASSWORD=rtap pg_isready -h localhost -p 5432 -U rtap -d rtap_ci && exit 0
53+
echo "Postgres not ready yet, retry $i/30..."
54+
sleep 1
55+
done
56+
echo "Postgres did not become ready in time" >&2
57+
exit 1
4858
4959
- name: Apply migrations
5060
run: npm run db:deploy

0 commit comments

Comments
 (0)