From 6266be0fb11705de845c6b1cd6dcdbd87cecfcc8 Mon Sep 17 00:00:00 2001 From: Garima Ketan Chauhan Date: Thu, 3 Apr 2025 00:27:14 +0200 Subject: [PATCH] Update deploy_test.yml --- .github/workflows/deploy_test.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy_test.yml b/.github/workflows/deploy_test.yml index 1014def..2b93d94 100644 --- a/.github/workflows/deploy_test.yml +++ b/.github/workflows/deploy_test.yml @@ -22,6 +22,13 @@ jobs: export-variables: true keys-case: bypass + # Remove previous production containers at the beginning + - name: Remove previous production containers (if any) + run: docker rm -f secfit_stag_backend || true # Remove any previous containers + + - name: Tear down previous production containers (if any) + run: docker compose -f $COMPOSE_FILE down || true + - name: Set up test containers run: docker compose -f docker-compose.stag.yml up --build -d @@ -31,17 +38,5 @@ jobs: - name: Tear down test containers run: docker compose -f docker-compose.stag.yml down - - name: Tear down previous production containers (if any) - run: docker compose -f $COMPOSE_FILE down || true - - name: Build and run docker image - run: docker compose -f $COMPOSE_FILE up --force-recreate --build -d - - - name: Print deployment message - run: | - echo "Code has been updated and deployed to the server!" - echo "Commit hash: ${{ github.sha }}" - echo "Branch: ${{ github.ref }}" - - - name: Verify that gateway is available - run: docker ps + run: docker compose -f $COMPOSE_FILE up --_