Github Actions
常用Actions¶
Checkout¶
| Text Only | |
|---|---|
ssh-key一般要配置Deploy keys,感觉使用token配置PAT更灵活。
- How to git clone a private repo with a private submodule in a GitHub Action? 有一个总结
- When checking out a repo on Github Actions workflow, how do I pass in a key for a private submodule but not the repo itself?有一些讨论
Cache¶
- https://github.com/actions/cache
- 如果项目不大的话,效果不大,最多是缓存一下依赖
artifacts¶
- https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
- https://github.com/actions/download-artifact
- https://github.com/actions/upload-artifact
环境变量¶
- Context https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
- Variables https://docs.github.com/en/actions/learn-github-actions/variables
比如触发workflow的hash可以用
github.sha或者GITHUB_SHA
徽章¶
- Github默认提供的只有一种
- Shields.io提供了五花八门的各类图标
ref¶
- 本地运行 act/act - 镜像 不是100%等价,但是可以模拟个大概,提高yml编写效率
- 别的Linux/Unix环境 Cross Platform Action · Actions · GitHub Marketplace · GitHub
- setup-qemu-action
- macOS镜像 Docker-OSX,被苹果DMCA了,只能自己打包镜像