forked from Spynacz/concertify
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.33 KB
/
Docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Testing Docker
on: [push, pull_request]
jobs:
build_and_run_docker:
name: Test Docker
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }}
REDIS_CELERY: ${{ secrets.REDIS_CELERY }}
REDIS_CACHE: ${{ secrets.REDIS_CACHE }}
DJANGO_SETTINGS_MODULE: ${{ secrets.DJANGO_SETTINGS_MODULE }}
steps:
- uses: actions/checkout@v4
- name: Run Django tests
run: |
cat << EOF > .env
SECRET_KEY = "${SECRET_KEY}"
POSTGRES_DB = "${POSTGRES_DB}"
POSTGRES_USER = "${POSTGRES_USER}"
POSTGRES_PASSWORD = "${POSTGRES_PASSWORD}"
POSTGRES_HOST = "${POSTGRES_HOST}"
POSTGRES_PORT = "${POSTGRES_PORT}"
DJANGO_SETTINGS_MODULE = "${DJANGO_SETTINGS_MODULE}"
REDIS_PASS = "${REDIS_PASS}"
REDIS_CELERY = "${REDIS_CELERY}"
REDIS_CACHE = "${REDIS_CACHE}"
EOF
- name: Run docker compose build
run: docker compose build
- name: Run docker compose up
run: docker compose up --wait
- name: Run docker compose down
run: docker compose down