github-actions

Is it possible to define more than one GitHub Actions workflow per YAML file?


I would like to define various workflows that are all related in a single YAML file. Is this possible?


Solution

  • I could not find any official documentation, so I just tried out the idea myself, and I think you cannot define multiple workflows per single YAML file.

    Here is github action run log, https://github.com/chenrui333/github-action-test/actions/runs/157799207.

    Also, you cannot use YAML anchor syntax either, see more discussion in this Github Action thread.