2019-08-31 10:36:00 +00:00
|
|
|
# GitHub Actions
|
|
|
|
|
2019-09-20 06:08:30 +00:00
|
|
|
GitHub [Actions](https://github.com/features/actions) 是 GitHub 推出的一款 CI/CD 工具。
|
2019-08-31 10:36:00 +00:00
|
|
|
|
2019-09-20 06:08:30 +00:00
|
|
|
我们可以在每个 `job` 的 `step` 中使用 Docker 执行构建步骤。
|
2019-08-31 10:36:00 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
on: push
|
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
my-job:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
- name: run docker container
|
|
|
|
uses: docker://golang:alpine
|
|
|
|
with:
|
|
|
|
args: go version
|
|
|
|
```
|
|
|
|
|
|
|
|
## 参考资料
|
|
|
|
|
2021-03-02 16:11:07 +00:00
|
|
|
* [Actions Docs](https://docs.github.com/en/actions)
|