mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
Fix guide issues
This commit is contained in:
@@ -4,9 +4,11 @@ GitHub [Actions](https://github.com/features/actions) 是 GitHub 推出的一款
|
||||
|
||||
我们可以在每个 `job` 的 `step` 中使用 Docker 执行构建步骤。
|
||||
|
||||
## 21.2.1 最小可用示例
|
||||
### 21.2.1 最小可用示例
|
||||
|
||||
在仓库根目录创建 `/.github/workflows/ci.yml`:
|
||||
更多语法、权限模型和可用 action,请以 [GitHub Actions 官方文档](https://docs.github.com/en/actions) 为准。
|
||||
|
||||
在仓库根目录创建 `.github/workflows/ci.yml`:
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
@@ -32,7 +34,7 @@ jobs:
|
||||
```
|
||||
该示例会在 GitHub Actions 中构建当前仓库的 Docker 镜像(不推送到 registry)。
|
||||
|
||||
## 21.2.2 最佳实践
|
||||
### 21.2.2 最佳实践
|
||||
|
||||
* 固定 action 的主版本(例如 `@v4` / `@v6`),避免使用 `@master` 这类浮动引用。
|
||||
* 设置最小权限(例如 `contents: read`),需要写入权限时再打开。
|
||||
@@ -46,7 +48,3 @@ jobs:
|
||||
with:
|
||||
args: go version
|
||||
```
|
||||
|
||||
## 21.2.3 参考资料
|
||||
|
||||
* [Actions Docs](https://docs.github.com/en/actions)
|
||||
|
||||
Reference in New Issue
Block a user