From 6020426815387e82ecae951f37dde28d69b73d1a Mon Sep 17 00:00:00 2001 From: ci Date: Tue, 20 Oct 2026 19:16:06 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=89=8B=E5=8A=A8=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..dc5f58a --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: deploy +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: docker + steps: + - name: SSH build spider + 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/spider && git pull --ff-only origin dev && /usr/local/go/bin/go build -o bin/spider . && echo SPIDER_OK"