fix(deploy): scripts/deploy.sh uses fetch+reset like the workflow
Some checks failed
Deploy / Deploy to Production (push) Has been cancelled
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:
@@ -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)..."
|
||||
|
||||
Reference in New Issue
Block a user