From 6134593c977485ae6e7b5f46ba7b4c6d8fc16574 Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Mon, 5 Feb 2024 12:16:44 +0100 Subject: [PATCH] ci: Split up the backend's deploy commands --- .github/workflows/podman.yml | 10 +++++++--- docker-compose-deploy.yml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/podman.yml b/.github/workflows/podman.yml index ac4a845eb..83ed8c2b6 100644 --- a/.github/workflows/podman.yml +++ b/.github/workflows/podman.yml @@ -38,11 +38,15 @@ jobs: - uses: actions/checkout@v4 - name: Build Podman images run: podman-compose -f docker-compose-deploy.yml build + - name: Apply Django migrations + run: podman-compose -f docker-compose-deploy.yml run --rm web python manage.py migrate --noinput + - name: Run custom Django bootstrap management command + run: podman-compose -f docker-compose-deploy.yml run --rm web python manage.py bootstrap + - name: Collect static files + run: podman-compose -f docker-compose-deploy.yml run --rm web python manage.py collectstatic --noinput - name: Deploy Podman images run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate - name: Check Podman images run: podman-compose -f docker-compose-deploy.yml ps - name: Check logs - run: podman-compose -f docker-compose-deploy.yml logs - - name: Check if Django's superuser environment variables are set - run: echo $DJANGO_SUPERUSER_USERNAME $DJANGO_SUPERUSER_PASSWORD $DJANGO_SUPERUSER_EMAIL \ No newline at end of file + run: podman-compose -f docker-compose-deploy.yml logs \ No newline at end of file diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index dc0f29c98..738ce0f77 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -54,7 +54,7 @@ services: - SQL_HOST=${SQL_HOST} ports: - 8000:8000 - command: bash -c "python manage.py migrate && python manage.py bootstrap && python manage.py runserver 0.0.0.0:8000" + command: gunicorn aml.wsgi:application --bind 0.0.0.0:8000 client-builder: build: context: ./frontend