Does Github Actions have templates

时光怂恿深爱的人放手 提交于 2020-01-25 08:14:21

问题


As I have repetitve steps in my Github Actions, I would like to create a template. Let's make a example

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

Is it possible to save only the steps in a separated file? And import afterwards?


回答1:


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.



来源:https://stackoverflow.com/questions/59230841/does-github-actions-have-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!