github-actions - Github Actions 有模板吗
问题描述
由于我的 Github Actions 中有重复的步骤,我想创建一个模板。让我们举个例子
name: ci
on: ["push"]
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v1
- name: do stuff
run: |
bash stuff
是否可以仅将步骤保存在单独的文件中?然后导入?
解决方案
Unfortunately it does not look like github-actions supports reusing workflows. Not even YAML anchors are supported.
It looks like the only way to share steps (not setup) is to create actions.
Update: A storm brewing
I have also caught wind of the possibility of reusing actions. Follow the issue to stay up-to-date.
推荐阅读
- r - 使用R中的for循环将嵌套数据中的日期重新编码为连续的长文件
- excel - 如何打印一系列纸张?
- angular - ngx 正式混合无线电和选择
- python-3.x - 带有 EarlyStopping 的 TensorFlow 2.0 GradientTape
- javascript - 如何在页面加载时保持手风琴面板打开,但之后保持其可折叠性?
- r - 无法将字符/因子类转换为日期
- dictionary - 如何在go中使用空结构值制作地图
- xml - 根据相互关联的属性进行连接
- java - .jar 文件在 IntelliJ 中工作,但是当 .jar 在 IntelliJ 之外运行时会发生 JVM 错误
- python - 如何让 Pandas 正确识别我的数据结构?