diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 537b526..382b91a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -203,6 +203,9 @@ jobs: # Install deps and restart on server echo "Installing deps and restarting PM2..." - ssh -o ConnectTimeout=60 -o StrictHostKeyChecking=no tyler@route.crispygoat.com "cd $APP_DIR && npm install --omit=dev 2>&1 | tail -5 && pm2 restart route-commerce || pm2 start npm --name route-commerce -- start -- -p 3100 && pm2 save && sleep 4 && curl -f -s http://localhost:3100/api/health/db-schema || { echo 'Health check failed after start - schema not applied (see plan)'; exit 1; }" + # IMPORTANT: --update-env so PM2 re-reads .env. Without it PM2 keeps + # the original env vars cached at first start and silently ignores + # newly added ones (like SMARTSHEET_*). + ssh -o ConnectTimeout=60 -o StrictHostKeyChecking=no tyler@route.crispygoat.com "cd $APP_DIR && npm install --omit=dev 2>&1 | tail -5 && pm2 restart route-commerce --update-env || pm2 start npm --name route-commerce -- start -- -p 3100 && pm2 save && sleep 4 && curl -f -s http://localhost:3100/api/health/db-schema || { echo 'Health check failed after start - schema not applied (see plan)'; exit 1; }" echo "Deployed successfully" \ No newline at end of file