Skip to content

Commit 6dd50b0

Browse files
committed
GHA | adding wait for postgres
1 parent f169fd6 commit 6dd50b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868
docker-images: true
6969
large-packages: true
7070
swap-storage: true
71-
apt: true
7271

7372
- uses: actions/checkout@v3
7473
- name: Set up Python
@@ -87,6 +86,15 @@ jobs:
8786
python -m venv venv
8887
. venv/bin/activate
8988
pip install --cache-dir ~/.cache/pip -r requirements.txt
89+
- name: Wait for Postgres
90+
run: |
91+
echo "Waiting for Postgres..."
92+
for i in {1..30}; do
93+
pg_isready -h db -p 5432 -U postgres && echo "Postgres ready!" && exit 0
94+
echo "Still waiting..."
95+
sleep 2
96+
done
97+
echo "Postgres did not start!" && exit 1
9098
- name: Wait for Elasticsearch HTTP
9199
run: |
92100
echo "Waiting for Elasticsearch..."

0 commit comments

Comments
 (0)