From 3254e638df0fb06f7082e5013ac744ee4aaa533a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Alexander=20Str=C3=B8mseng?= Date: Thu, 18 Apr 2024 13:59:24 +0200 Subject: [PATCH] Update autoredeploy.yml, use docker compose down change to using docker compose down instead of complicated logic for figuring out old images and containers --- .github/workflows/autoredeploy.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/autoredeploy.yml b/.github/workflows/autoredeploy.yml index 6a3466a..c40da8e 100644 --- a/.github/workflows/autoredeploy.yml +++ b/.github/workflows/autoredeploy.yml @@ -11,17 +11,8 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v3 - - name: Stop and remove containers, then remove images - run: | - # Find and stop containers running from 'backend:outreach' image, then remove them - docker ps -aq --filter ancestor=backend:outreach | xargs -r docker stop | xargs -r docker rm - - # Find and stop containers running from 'frontend:outreach' image, then remove them - docker ps -aq --filter ancestor=frontend:outreach | xargs -r docker stop | xargs -r docker rm - - # Now, remove the images - docker rmi backend:outreach frontend:outreach || true - + - name: Stop and remove containers and images, using docker compose down + run: docker-compose down - name: Create .env files run: | # Create .env with all variables except HOST_URL Backend