preset dotnet 重命名为 dotnet10
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
- `context`:指定构建目录(前端/后端在子目录时用)
|
||||
- `dockerfile`:指定 Dockerfile 的完整路径
|
||||
- `preset`:内置方案,对应 action 根目录下的 `vue3.Dockerfile`、`vue3-hash.Dockerfile`、`dotnet.Dockerfile`
|
||||
- `preset`:内置方案,对应 action 根目录下的 `vue3.Dockerfile`、`vue3-hash.Dockerfile`、`dotnet10.Dockerfile`
|
||||
|
||||
优先级:**`dockerfile` > `preset` > `context` 下的默认 `Dockerfile`**。
|
||||
设置了 `dockerfile` 时完全忽略 `preset`;设置了 `preset` 时用对应的 Dockerfile 构建,构建完自动 push 到 registry。
|
||||
@@ -15,11 +15,11 @@
|
||||
| --- | --- | --- |
|
||||
| `vue3` | `vue3.Dockerfile` | Vue3 + history 路由,nginx 做 `try_files` 回退并带跨域头 |
|
||||
| `vue3-hash` | `vue3-hash.Dockerfile` | Vue3 + hash 路由,nginx 默认配置 |
|
||||
| `dotnet` | `dotnet.Dockerfile` | .NET self-contained 发布(linux-x64) |
|
||||
| `dotnet10` | `dotnet10.Dockerfile` | .NET 10 self-contained 发布(linux-x64) |
|
||||
|
||||
- 编译全部写在 Dockerfile 里(多阶段构建),action 本身只负责传 `--build-arg VERSION=<tag>`:
|
||||
- vue:`npm ci` → `npm run build-only`(没有该脚本时回退 `npm run build`)→ `npm pkg set version=<tag>`
|
||||
- dotnet:`dotnet publish -r linux-x64 -c Release --self-contained -p:AssemblyName=App -p:Version=<tag>`
|
||||
- dotnet10:`dotnet publish -r linux-x64 -c Release --self-contained -p:AssemblyName=App -p:Version=<tag>`
|
||||
- `vue3` 的 nginx 配置也内联在 Dockerfile 里:`context` 下有 `nginx.conf` 就用项目的,否则用内置默认配置(history 回退 + 跨域头)。
|
||||
|
||||
## 参数
|
||||
@@ -34,7 +34,7 @@
|
||||
| `platform` | 否 | `linux/amd64` | 构建平台 |
|
||||
| `context` | 否 | `.` | 构建目录,相对仓库根目录 |
|
||||
| `dockerfile` | 否 | 空 | Dockerfile 完整路径(相对仓库根目录或绝对路径) |
|
||||
| `preset` | 否 | 空 | 内置方案:`vue3` / `vue3-hash` / `dotnet` |
|
||||
| `preset` | 否 | 空 | 内置方案:`vue3` / `vue3-hash` / `dotnet10` |
|
||||
|
||||
## 示例
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
- uses: actions/magic-docker@main
|
||||
with:
|
||||
context: backend
|
||||
preset: dotnet
|
||||
preset: dotnet10
|
||||
```
|
||||
|
||||
### 使用自己的 Dockerfile
|
||||
|
||||
Reference in New Issue
Block a user