fix(deploy): scripts/deploy.sh uses fetch+reset like the workflow
Some checks failed
Deploy / Deploy to Production (push) Has been cancelled

The workflow yaml was updated to fetch+reset but the production server
appears to auto-run scripts/deploy.sh on SSH login (via .bashrc/.profile
hook), so the workflow's inline commands never reach the server.
Update deploy.sh itself to use the same fetch+reset pattern.
This commit is contained in:
Semih
2026-05-11 00:02:41 +00:00
parent e978efa37c
commit 70ad2add16

View File

@@ -27,9 +27,13 @@ cd "$DEPLOY_DIR" || error_exit "Cannot change to project directory: $DEPLOY_DIR"
log "Starting zero-downtime deployment..."
log "Working directory: $DEPLOY_DIR"
# ── Step 1: Pull latest changes ──
log "Pulling latest changes from origin..."
git pull origin main || error_exit "git pull failed"
# ── Step 1: Sync to origin/main ──
# Hard reset (not pull) so stale build artifacts on the deploy server
# (e.g. apps/web/tsconfig.tsbuildinfo) don't block updates. The deploy
# server is treated as a deployment target, not a development checkout.
log "Fetching and resetting to origin/main..."
git fetch origin main || error_exit "git fetch failed"
git reset --hard origin/main || error_exit "git reset --hard failed"
# ── Step 2: Install dependencies ──
log "Installing dependencies (frozen lockfile)..."