Skip to content

Commit 63bbc5b

Browse files
ImTotemclaude
andcommitted
fix(ci): use git reset --hard for deploy and remove orphan containers
- git pull fails when deploy.sh has modified tracked files (sed on nginx.conf) - git reset --hard origin/main is safe since .env/credentials are untracked - --remove-orphans cleans up old Docker nginx/certbot containers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 70d7e82 commit 63bbc5b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ jobs:
8686
port: ${{ secrets.SERVER_PORT }}
8787
script: |
8888
cd ~/BCSD_API
89-
git pull origin main
89+
git fetch origin main
90+
git reset --hard origin/main
9091
bash infra/scripts/deploy.sh

infra/scripts/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ echo "1. Building $NEXT..."
6464
$COMPOSE build "api-${NEXT}"
6565

6666
echo "2. Starting $NEXT..."
67-
$COMPOSE up -d "api-${NEXT}"
67+
$COMPOSE up -d --remove-orphans "api-${NEXT}"
6868

6969
echo "3. Health check on api-${NEXT}..."
7070
if ! health_check "$NEXT"; then

0 commit comments

Comments
 (0)