Skip to content

Refactor develop and production environment configuration #24

Refactor develop and production environment configuration

Refactor develop and production environment configuration #24

Workflow file for this run

name: Backend CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
container_django: docker-ngen-django-1
steps:
- uses: actions/checkout@v3
- name: Build develop docker containers for Django backend
run: |
cd docker
docker compose -f docker-compose-dev.yml build ngen-django
docker compose -f docker-compose-dev.yml up -d ngen-django
# Test if django container is running
max_retries=60
retries=0
while [[ "$(docker inspect -f '{{.State.Running}}' "$container_django")" != "true" ]]; do
retries=$((retries + 1))
if [ $retries -ge $max_retries ]; then
echo "Container '$container_django' did not start within the timeout."
exit 1
fi
sleep 1
done
- name: Run Django tests
run: docker exec "$container_django" ./manage.py test ngen.tests