chore: 添加powerShell脚本构建提交
This commit is contained in:
@@ -43,11 +43,23 @@
|
||||
|
||||
### 方式一:使用自动化脚本(推荐)
|
||||
|
||||
**Windows PowerShell 用户**:
|
||||
```powershell
|
||||
# 在项目根目录执行
|
||||
.\scripts\deploy\build-and-push.ps1
|
||||
```
|
||||
|
||||
**Linux/Mac 用户**:
|
||||
```bash
|
||||
# 在项目根目录执行
|
||||
./scripts/deploy/build-and-push.sh
|
||||
```
|
||||
|
||||
**或者使用 Git Bash(Windows)**:
|
||||
```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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user