From d83420c6c03172157094150767144e6944734486 Mon Sep 17 00:00:00 2001 From: toom1996 <1023150697@qq.com> Date: Tue, 20 Oct 2026 19:15:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E6=89=8B=E5=8A=A8=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=20workflow=5Fdispatch=20+=20=E7=BA=AF=20run=20=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 8d1d513..d520969 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,18 +1,22 @@ name: deploy on: - push: - branches: [main, master] + workflow_dispatch: jobs: deploy: runs-on: docker steps: - - name: SSH 到服务器执行上线脚本 - uses: appleboy/ssh-action@v1 - with: - host: ${{ secrets.DEPLOY_HOST }} - username: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_KEY }} - script: | - cd /opt/fashion/test - ./deploy.sh + - name: SSH deploy + shell: sh + env: + KEY_B64: ${{ secrets.DEPLOY_KEY_B64 }} + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + run: | + set -e + apk add --no-cache openssh-client >/dev/null 2>&1 || true + mkdir -p "$HOME/.ssh" + echo "$KEY_B64" | base64 -d > "$HOME/.ssh/id" + chmod 600 "$HOME/.ssh/id" + ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "$HOME/.ssh/id" \ + "$DEPLOY_USER@$DEPLOY_HOST" "cd /opt/fashion/backend_v2 && ./deploy.sh web" From 29c2d77a8585ff20a7ed193cd45a7a291c63befe Mon Sep 17 00:00:00 2001 From: ci Date: Tue, 20 Oct 2026 22:54:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20=E5=89=8D=E7=AB=AF=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=20--no-cache=20=E4=BB=A5=E5=88=B7=E6=96=B0?= =?UTF-8?q?=20SSG=20=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index d520969..cb1a578 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -19,4 +19,4 @@ jobs: echo "$KEY_B64" | base64 -d > "$HOME/.ssh/id" chmod 600 "$HOME/.ssh/id" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i "$HOME/.ssh/id" \ - "$DEPLOY_USER@$DEPLOY_HOST" "cd /opt/fashion/backend_v2 && ./deploy.sh web" + "$DEPLOY_USER@$DEPLOY_HOST" "cd /opt/fashion/backend_v2 && ./deploy.sh web --no-cache"