Skip to content

Commit 53ae815

Browse files
committed
fix: stash unexpected local drift on server before pulling in deploy
The last deploy failed because resources/js/Pages/Checkout/Summary.vue had uncommitted local changes on the production server, blocking git pull's fast-forward merge. The server never runs npm run build (assets are built on CI and rsynced), so tracked source files there should always be clean; stash any drift non-destructively instead of letting the whole deploy abort.
1 parent a589c0b commit 53ae815

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ jobs:
103103
cd $DEPLOY_PATH
104104
105105
echo "==> Pulling latest code"
106-
git pull origin main
106+
git fetch origin main
107+
if ! git diff --quiet || ! git diff --cached --quiet; then
108+
echo "==> Stashing unexpected local changes on server before pulling"
109+
git stash push -u -m "auto-stash before deploy \$(date -u +%Y-%m-%dT%H:%M:%SZ)"
110+
fi
111+
git merge --ff-only origin/main
107112
108113
echo "==> Installing PHP dependencies"
109114
if command -v composer >/dev/null 2>&1; then

0 commit comments

Comments
 (0)