feat: .devops/wyx_helpcenter.yml

This commit is contained in:
wyxttn 2026-05-13 09:59:23 +08:00 committed by jianmu
parent d74dc50617
commit c040eecb75
1 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,53 @@
version: 2
name: wyx_helpcenter
description: "代码提交时自动构建并部署到服务器"
trigger:
webhook: gitlink@1.0.0
event:
- ref: push
ruleset-operator: AND
global:
concurrent: 1
workflow:
- ref: start
name: 开始
task: start
- ref: git_clone_0
name: git clone
task: git_clone@1.2.9
input:
remote_url: '"https://gitlink.org.cn/wyxttn/gitlink_help_center.git"'
ref: '"refs/heads/master"'
commit_id: '""'
depth: 1
needs:
- start
- ref: scp_resource_0
name: scp拷贝代码到服务器
task: scp_resource@1.4.3
input:
ssh_pass: ((wyx_helpcenter_ssh_pass))
ssh_ip: '"121.41.212.97"'
ssh_port: '"22"'
ssh_user: '"root"'
remote_file: '"/root/gitlink_help_center"'
local_file: ((git_clone_0.git_path))
file_content: '""'
needs:
- git_clone_0
- ref: ssh_cmd_0
name: Docker构建并运行
task: ssh_cmd@1.1.1
input:
ssh_pass: ((wyx_helpcenter_ssh_pass))
ssh_ip: '"121.41.212.97"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"cd /root/gitlink_help_center && docker build -t help_center . && docker stop help_center || true && docker rm help_center || true && docker run -d -p 3000:3000 --name help_center help_center"'
needs:
- scp_resource_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0