ci: switch prod deploy to server-side git pull and go build

This commit is contained in:
root
2026-03-10 00:43:23 +08:00
parent be5a1bcdd1
commit 4ff97b2665
4 changed files with 116 additions and 43 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ health_check() {
}
restart_service() {
if command -v systemctl >/dev/null 2>&1 && systemctl list-unit-files | grep -q "^${SERVICE_NAME}.service"; then
if command -v systemctl >/dev/null 2>&1 && systemctl cat "${SERVICE_NAME}.service" >/dev/null 2>&1; then
log "restarting systemd service: ${SERVICE_NAME}"
systemctl restart "$SERVICE_NAME"
else
@@ -58,7 +58,7 @@ create_service_if_needed() {
return 0
fi
if systemctl list-unit-files | grep -q "^${SERVICE_NAME}.service"; then
if systemctl cat "${SERVICE_NAME}.service" >/dev/null 2>&1; then
return 0
fi