Skip to content

Commit

Permalink
fix: action aadjust
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusNevs committed Oct 27, 2024
1 parent 0b16902 commit 680fc56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/cd-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 680fc56

Please sign in to comment.