GitHub Actions: can I dynamically generate and run a child workflow?

Viewed 83

We are migrating from gitlab to github.

With gitlab pipelines I am checking the repository and dynamically generating a child pipeline with the actual jobs to run. This is easiest explained by the actual definition:

stages:
    - bootstrap
    - run


    
# ---------------------------------------------------------------------------
# Bootstrap
# ---------------------------------------------------------------------------

bootstrap:
    stage: bootstrap
    # this will write the file jobs.yml to disk
    script: ./bootstrap.ps1

    artifacts:
        paths:
            - artifacts/jobs.yml



# ---------------------------------------------------------------------------
# Run
# ---------------------------------------------------------------------------

run:
    stage: run
    trigger:
        include:
            - artifact: artifacts/jobs.yml
              job: bootstrap
        strategy: depend

Is there anything similar in github actions? I found that it's possible to dynamically generate a matrix, but that is not enough.

I need to run jobs that depend on each other and run in parallel/sequence.

Example:

enter image description here

This whole job graph is dynamically generated.

Here I'd have three stages where all the app jobs run in parallel, and the single deploy job waits for all app jobs to complete.

I also need to pass outputs from the app jobs to the deploy job, which also seems to not really work with a matrix: https://github.com/github-community/community/discussions/17245

even if the output is set by multiple matrix variations of the job, only one is retained.


So, actual question is there a way to generate a workflow with multiple interdependent jobs on the fly and execute it, or is this something that just doesn't exist?

0 Answers
Related