All checks were successful
CI / build (push) Successful in 2m31s
登录页切换为官方 input-group 组合并将全站提示从 antd message 统一为 sonner toast,确保通知位置与风格一致。同时补齐相关 shadcn CLI 生成组件及构建配置更新。 Co-authored-by: Cursor <cursoragent@cursor.com>
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Deploy To Server
|
|
|
|
on:
|
|
# 暂停自动/手动部署触发;需要恢复时改回 push / workflow_dispatch。
|
|
workflow_dispatch:
|
|
inputs:
|
|
disabled:
|
|
description: "Deployment is temporarily disabled"
|
|
required: false
|
|
default: "true"
|
|
|
|
concurrency:
|
|
group: deploy-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
deploy:
|
|
if: ${{ false }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy over SSH
|
|
env:
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
|
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
DEPLOY_SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
|
|
DEPLOY_SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }}
|
|
DEPLOY_WORKDIR: ${{ secrets.DEPLOY_WORKDIR }}
|
|
run: |
|
|
set -eu
|
|
|
|
mkdir -p ~/.ssh
|
|
chmod 700 ~/.ssh
|
|
printf '%s\n' "$DEPLOY_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
printf '%s\n' "$DEPLOY_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
|
chmod 644 ~/.ssh/known_hosts
|
|
|
|
SSH_PORT="${DEPLOY_PORT:-22}"
|
|
REMOTE_DIR="${DEPLOY_WORKDIR:-/opt/chat-one-web}"
|
|
|
|
ssh -p "$SSH_PORT" "$DEPLOY_USER@$DEPLOY_HOST" <<EOF
|
|
set -eu
|
|
cd "$REMOTE_DIR"
|
|
git pull --ff-only
|
|
docker compose up -d --build
|
|
docker image prune -f
|
|
EOF
|