Files
InsightReply/.gitea/workflows/deploy.yml
zs 1a952d28b2
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 1m43s
Add build and deploy workflow
2026-02-28 20:08:20 +08:00

52 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: build-and-deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: arm
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: 获取代码
uses: actions/checkout@v4
- name: 安装 Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: 构建后端服务 (Server)
run: |
cd server
go build -o server_bin ./cmd/server
- name: 安装 Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: 构建浏览器扩展 (Extension)
run: |
cd extension
npm install
npm run build
- name: 部署到测试服务器
uses: up9cloud/action-rsync@master
env:
USER: root
HOST: 144.24.60.0
KEY: ${{secrets.USAARMLOGIN_SSH_KEY}}
# 根据你的实际需要,调整要排除的文件及目录。
# 这里排除了 .git以及前端的 node_modules 和 src 等源码。
ARGS: -avz --delete --exclude='.git/' --exclude='extension/node_modules/' --exclude='extension/src/'
SSH_ARGS: "-p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
# 如果你要部署整个项目根目录,使用 ./
SOURCE: ./
# 请将 TARGET 替换为你在此项目的实际部署路径
TARGET: /var/admin/InsightReply/
VERBOSE: true