Skip to content

Commit

Permalink
Use PostGres DB for Action workflow (#16)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kirsten238 authored Nov 18, 2021
1 parent 1283418 commit 4c2f25c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,21 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chatdb
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
env:
PSQL_PASS: 12345
PSQL_USER: user
strategy:
max-parallel: 4
matrix:
Expand All @@ -40,6 +49,12 @@ jobs:
DJANGO_SUPERUSER_PASSWORD: admin
DJANGO_SUPERUSER_USERNAME: admin
DJANGO_SUPERUSER_EMAIL: [email protected]
DJANGO_SETTINGS_MODULE: django_channel_tutorial.production
PSQL_NAME: chatdb
PSQL_HOST: 127.0.0.1
PSQL_PORT: 5432
PSQL_USER: postgres
PSQL_PASS: postgres
run: |
python manage.py migrate
python manage.py createsuperuser --no-input
Expand Down

0 comments on commit 4c2f25c

Please sign in to comment.