fix(deploy): CORS 用 JSON 数组、Redis 口令说明,部署时自动刷新 systemd 单元
CI / backend (push) Canceled after 0s

This commit is contained in:
2026-10-30 22:01:00 +08:00
parent 2a118ad407
commit 2ff1f6e9cd
3 changed files with 16 additions and 6 deletions
+4 -3
View File
@@ -61,10 +61,11 @@ step "4. 前端构建(只在服务器上、只用 HEAD 的源码)"
( cd web && npm ci --no-audit --no-fund --registry="$NPM_REGISTRY" && npm run build )
test -f web/dist/index.html || die "前端构建产物缺失:web/dist/index.html"
step "5. 写入构建标记并重启服务"
mkdir -p "$CONF_DIR" backend/var/uploads
step "5. 写入构建标记、刷新 systemd 单元并重启服务"
mkdir -p "$CONF_DIR" "$HOME/.config/systemd/user" backend/var/uploads
chmod 700 "$CONF_DIR"
printf 'BUILD_COMMIT=%s\nBUILD_TIME=%s\n' "$SHORT" "$(date -Iseconds)" >"$CONF_DIR/env.build"
cp deploy/prod/dadaotask-api.service "$HOME/.config/systemd/user/"
printf 'BUILD_COMMIT=%s\nBUILD_TIME=%s\n' "$SHORT" "$(TZ=Asia/Shanghai date -Iseconds)" >"$CONF_DIR/env.build"
chmod 600 "$CONF_DIR/env.build" "$ENV_FILE"
systemctl --user daemon-reload
systemctl --user enable "$SERVICE" >/dev/null 2>&1 || true