Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,18 @@ trap '_on_error "$LINENO"' ERR
REMOTE_HASH=$(git ls-remote origin -h refs/heads/main 2>/dev/null | cut -f1 || true)
LOCAL_HASH=$(git rev-parse HEAD 2>/dev/null || true)
if [[ -n "$REMOTE_HASH" && "$REMOTE_HASH" = "$LOCAL_HASH" ]]; then
say "Already running latest code ($(git rev-parse --short HEAD)) — skipping deploy."
send_admin "✅ Bot is already running the latest version (commit: $(git rev-parse --short HEAD))."
exit 0
ACTIVE="unknown"
if command -v systemctl >/dev/null 2>&1; then
ACTIVE="$(systemctl is-active "${APP_NAME}.service" 2>/dev/null || echo unknown)"
fi
if [[ "$ACTIVE" == "active" ]]; then
say "Already running latest code ($(git rev-parse --short HEAD)) — skipping deploy."
send_admin "✅ Bot is already running the latest version (commit: $(git rev-parse --short HEAD))."
exit 0
else
warn "Code is up to date but service status is: $ACTIVE — continuing deploy to (re)start service."
send_admin "ℹ️ Code is up to date but service status is: $ACTIVE — continuing deploy to (re)start service."
fi
fi

# Resolve human-readable source label for notifications
Expand Down
Loading
Loading