Skip to content

Commit 4c2f25c

Browse files
authored
Use PostGres DB for Action workflow (#16)
* Update django.yml * Update django.yml * Update django.yml * Use PostGres in workflows * Update django.yml * Update django.yml * Update django.yml * Update django.yml
1 parent 1283418 commit 4c2f25c

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/django.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,21 @@ jobs:
1212
runs-on: ubuntu-latest
1313
services:
1414
postgres:
15-
image: postgres:latest
15+
image: postgres
16+
# Provide the password for postgres
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
POSTGRES_DB: chatdb
21+
# Set health checks to wait until postgres has started
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
1627
ports:
28+
# Maps tcp port 5432 on service container to the host
1729
- 5432:5432
18-
env:
19-
PSQL_PASS: 12345
20-
PSQL_USER: user
2130
strategy:
2231
max-parallel: 4
2332
matrix:
@@ -40,6 +49,12 @@ jobs:
4049
DJANGO_SUPERUSER_PASSWORD: admin
4150
DJANGO_SUPERUSER_USERNAME: admin
4251
DJANGO_SUPERUSER_EMAIL: [email protected]
52+
DJANGO_SETTINGS_MODULE: django_channel_tutorial.production
53+
PSQL_NAME: chatdb
54+
PSQL_HOST: 127.0.0.1
55+
PSQL_PORT: 5432
56+
PSQL_USER: postgres
57+
PSQL_PASS: postgres
4358
run: |
4459
python manage.py migrate
4560
python manage.py createsuperuser --no-input

0 commit comments

Comments
 (0)