duoqi-admin/.gitea/workflows/deploy.yml
Wang Zhuoxuan e0871d0b7a
Some checks failed
Build & Deploy Admin / deploy (push) Failing after 16s
docs: 添加部署方案文档与 Gitea Actions CI 配置
- 新增 CI 部署指南,包含 Runner 基础设施适配、HTTPS 证书实操经验、故障排查
- 新增 deploy.yml workflow,基于 Act Runner volume 挂载实现原子部署
2026-04-22 03:04:26 +08:00

36 lines
922 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 & Type check
run: |
bun run lint
bun run typecheck
- 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