Update deploy to use PM2, add .next.prev to gitignore
Deploy / release (push) Skipped
Deploy / deploy (push) Failing after 38s

This commit is contained in:
openhands committed 2026-07-23 19:09:05 +02:00
1 parent a058a6e923
commit d9e95c823a
12 files changed
+14 -13

No files matched your search

+10 -9
View File
@@ -251,7 +251,7 @@ jobs:
if [ -n "${STAGE}" ] && [ -d "${STAGE}" ]; then
git -C "${LIVE}" worktree remove --force "${STAGE}" 2>/dev/null || rm -rf "${STAGE}" || true
fi
sudo systemctl start atom-nexst.service || true
pm2 start next || true
exit 1
}
trap 'error_handler $LINENO' ERR
@@ -319,8 +319,8 @@ jobs:
echo "Cutover: stop service (free DB connections), migrate, swap .next..."
CUTOVER_STARTED=1
sudo systemctl stop atom-nexst.service || true
pkill -f 'next-server' || true
pm2 stop next || true
sleep 2
# Give MariaDB a moment to reclaim the live pool.
sleep 2
@@ -372,12 +372,13 @@ jobs:
sudo chown -R www-data:www-data "${LIVE}"
echo "Starting systemd service..."
sudo systemctl start atom-nexst.service
echo "Starting PM2..."
pm2 start next --update-env || pm2 restart next --update-env
sleep 2
if ! systemctl is-active --quiet atom-nexst.service; then
echo "ERROR: atom-nexst.service failed to start!" >&2
sleep 3
if ! pm2 show next 2>/dev/null | grep -q 'online'; then
echo "ERROR: PM2 next failed to start!" >&2
pm2 logs next --lines 20 --nostream >&2 || true
exit 1
fi
@@ -397,7 +398,7 @@ jobs:
if [ "${HEALTH_OK}" != "1" ]; then
echo "ERROR: Health check failed after deploy (${HEALTH_URL})" >&2
echo "Last body: ${BODY:-<empty>}" >&2
journalctl -u atom-nexst.service -n 40 --no-pager >&2 || true
pm2 logs next --lines 40 --nostream >&2 || true
exit 1
fi
+1
View File
@@ -1,6 +1,7 @@
node_modules/
.turbo/
.next/
.next.prev/
next-env.d.ts
.env
*.tsbuildinfo
+1 -1
View File
@@ -1 +1 @@
{"previewModeId":"bfef72bdee7dadd04274877c72066cc9","previewModeSigningKey":"a955b4257ea6feed0eafdc5d75ee5b67c22ef67206ba68f31ed51c4b926b4ceb","previewModeEncryptionKey":"2a7f066562fb84951d3e3ef13e0aa843e6208a1d2cde7799cbc5c9bbae95d1f4","expireAt":1786034301802}
{"previewModeId":"9d3cdf6ac236161a86749c4bf39c3b96","previewModeSigningKey":"61361b2c54874ae756a6d5a022fb4155d75084adfce892918df9a6b3c533a896","previewModeEncryptionKey":"73208b7c131910e75d344ff7ea98d3d28de71f2613b7d063c6f31550f0d939af","expireAt":1786035096997}
+1 -1
View File
@@ -1 +1 @@
{"encryption.key":"VE1NjtT2PP/NDSoKkOsGd7s65nHwkz01xw2rcnEK+ks=","encryption.expire_at":1786034301798}
{"encryption.key":"2jI+IYNtUDV/7mrRhb7odaXpvSnAoHqbaeBjBIZ+uKQ=","encryption.expire_at":1786035096993}
@@ -1 +0,0 @@
{"kind":"FETCH","data":{"headers":{},"body":"[]","status":200,"url":""},"revalidate":60,"tags":["permissions"]}
@@ -1,5 +1,5 @@
{
"buildStage": "compile",
"buildStage": "static-generation",
"buildOptions": {
"useBuildWorker": "true"
}
View File
Whitespace-only changes.