ci: 合并 workflow,仅保留 push main 时自动部署

This commit is contained in:
hhs
2026-06-14 15:01:46 +08:00
parent e33b5650a5
commit 9e813f0a08
3 changed files with 0 additions and 87 deletions

View File

@@ -1,38 +0,0 @@
name: Backend CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci:
runs-on: aliyun
container: golang:1.26.2-alpine
defaults:
run:
working-directory: backend
steps:
- name: Setup Node.js
run: |
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk add --no-cache nodejs
working-directory: /
- name: Checkout
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4"
- name: Download Dependencies
run: go mod download
env:
GOPROXY: https://goproxy.cn,direct
- name: Vet
run: go vet ./...
- name: Build
run: go build ./cmd/server
- name: Test
run: go test ./...

View File

@@ -3,31 +3,9 @@ name: Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# ---- PR 时:验证 Docker 镜像可构建 ----
verify:
if: github.event_name == 'pull_request'
runs-on: aliyun
steps:
- name: Checkout
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4"
- name: Verify Frontend Build
run: docker build -t camtalk-frontend-test ./frontend
- name: Verify Backend Build
run: docker build -t camtalk-backend-test ./backend
- name: Cleanup
run: |
docker rmi camtalk-frontend-test camtalk-backend-test || true
# ---- push main 时:构建并部署 ----
deploy:
if: github.event_name == 'push'
runs-on: aliyun
steps:
- name: Checkout

View File

@@ -1,27 +0,0 @@
name: Frontend CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci:
runs-on: aliyun
container: node:22-alpine
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4"
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type Check & Build
run: npm run build