duoqi-admin/.gitea/workflows/deploy.yml
Wang Zhuoxuan 91f88acba7
All checks were successful
Build & Deploy Admin / deploy (push) Successful in 28s
ci: 移除不存在的 typecheck 脚本,类型检查已包含在 build 中
2026-04-22 15:13:21 +08:00

34 lines
869 B
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 & Deploy Admin
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Build
run: bun run build
env:
VITE_API_BASE_URL: ""
- name: Deploy to server
run: |
# 原子替换:通过 volume 挂载直接操作宿主机目录
mkdir -p /opt/duoqi-admin/dist-new
cp -r dist/* /opt/duoqi-admin/dist-new/
# 备份当前版本 + 切换mv 在同一文件系统上是原子操作)
mv /opt/duoqi-admin/dist /opt/duoqi-admin/dist-old || true
mv /opt/duoqi-admin/dist-new /opt/duoqi-admin/dist
rm -rf /opt/duoqi-admin/dist-old