chore: 添加powerShell脚本构建提交

This commit is contained in:
lzh
2025-12-23 13:46:15 +08:00
parent 25ebd947b8
commit 2b238136ad
2 changed files with 97 additions and 5 deletions

View File

@@ -43,11 +43,23 @@
### 方式一:使用自动化脚本(推荐)
**Windows PowerShell 用户**
```powershell
# 在项目根目录执行
.\scripts\deploy\build-and-push.ps1
```
**Linux/Mac 用户**
```bash
# 在项目根目录执行
./scripts/deploy/build-and-push.sh
```
**或者使用 Git BashWindows**
```bash
bash scripts/deploy/build-and-push.sh
```
脚本会自动:
- 清理旧的构建产物
- 安装依赖(如果需要)
@@ -73,7 +85,8 @@ git push origin master
## 文件说明
- `Dockerfile.deploy`: 仅用于部署的 Dockerfile不进行构建只复制构建产物
- `build-and-push.sh`: 本地构建和推送脚本
- `build-and-push.sh`: 本地构建和推送脚本Linux/Mac/Git Bash
- `build-and-push.ps1`: 本地构建和推送脚本Windows PowerShell
- `.gitea/workflows/deploy-web.yaml`: CI/CD 工作流配置(已修改为仅部署模式)
## CI/CD 触发条件
@@ -132,6 +145,20 @@ git ls-files apps/web-antd/dist
### 4. 工作流程建议
**推荐流程**
**Windows PowerShell**
```powershell
# 1. 开发阶段:修改源码(不会触发 CI/CD
# 使用你喜欢的编辑器修改 apps/web-antd/src/xxx.vue
# 2. 测试阶段:本地预览
pnpm dev:antd
# 3. 构建和部署:一键完成
.\scripts\deploy\build-and-push.ps1
```
**Linux/Mac/Git Bash**
```bash
# 1. 开发阶段:修改源码(不会触发 CI/CD
vim apps/web-antd/src/xxx.vue
@@ -139,10 +166,7 @@ vim apps/web-antd/src/xxx.vue
# 2. 测试阶段:本地预览
pnpm dev:antd
# 3. 构建阶段:生成构建产物
pnpm build:antd
# 4. 部署阶段:推送构建产物(触发 CI/CD
# 3. 构建和部署:一键完成
./scripts/deploy/build-and-push.sh
```