From 680fc56dec2551cbb76c8dc076f959cccd180243 Mon Sep 17 00:00:00 2001 From: MatheusNevs Date: Sun, 27 Oct 2024 12:51:06 -0300 Subject: [PATCH] fix: action aadjust --- .github/workflows/cd-action.yml | 21 +++------------------ start.sh | 2 +- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cd-action.yml b/.github/workflows/cd-action.yml index 4369300..338e214 100644 --- a/.github/workflows/cd-action.yml +++ b/.github/workflows/cd-action.yml @@ -27,29 +27,14 @@ jobs: host: ${{secrets.HOST}} username: ${{secrets.USERNAME}} password: ${{secrets.PASS}} - command_timeout: 540s + # command_timeout: 540s script: | UNSTAGGED_IMAGE_ID=$(docker images --filter=reference=site-struct-2024-web:latest --format "{{.ID}}") cd docker_compose_struct/ git pull cd site-struct-2024/ - - execute_with_retry() { - local retries=$1 - local command=$2 - while [ $retries -gt 0 ]; do - if $command; then - echo "$command successful!" - return 0 - else - echo "$command failed, retrying..." - ((retries--)) - fi - done - echo "$command failed after all retries" - exit 1 - } - + docker stop $(docker ps -aq) execute_with_retry 2 "docker compose build web" execute_with_retry 2 "docker compose up -d" + docker start $(docker ps -aq) docker rmi $UNSTAGGED_IMAGE_ID diff --git a/start.sh b/start.sh index ae4345d..9daa3d5 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,5 @@ #!/bin/sh -prisma db push --skip-generate +# prisma db push --skip-generate # prisma db push --skip-generate --force-reset # tsx prisma/seed.ts node server.js