chaining gh actions

04 Apr 2023 21:03 UTC-07:00

You can see an example of this in render-engine-rss

Quick Steps

Create your first workflow

For my workflow I'm running PyTest.

Ensure that the first workflow has workflow_call as a possible trigger.

    name: PyTest
        ... # other triggers

Create your second workflow and call the first in jobs

My second action is publishing based on Github Tagging (using setuptools_scm).

To reference the first action add it as a job and provide the path to the file in the uses path.

    uses: ./.github/workflows/test.yml
        ... # rest of workflow

Why I do this

I want to make sure that I don't have to do too much to deploy updates but I don't want to publish if I have failing tests.