ci(deploy): use fetch+reset instead of pull to ignore stale build artifacts
Some checks failed
Deploy / Deploy to Production (push) Has been cancelled
Some checks failed
Deploy / Deploy to Production (push) Has been cancelled
Production server's working tree had a modified tsbuildinfo from previous builds that was blocking 'git pull' after we removed the file from tracking. Switch to 'git fetch origin main + git reset --hard origin/main' so the deploy server always matches main exactly, ignoring any local working-tree state.
This commit is contained in:
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@@ -33,7 +33,11 @@ jobs:
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting deployment..."
|
||||
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Pulling latest changes..."
|
||||
git pull origin main
|
||||
git fetch origin main
|
||||
# Hard reset to remote to drop any stale build artifacts (e.g. tsbuildinfo)
|
||||
# that would otherwise block 'git pull'. The deploy server is treated as
|
||||
# a deployment target, not a development checkout.
|
||||
git reset --hard origin/main
|
||||
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - Installing dependencies..."
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
Reference in New Issue
Block a user