at the moment I have a lots of jobs in one .gitlab-ci.yml file. Since, they have different only and except parameters, at the moment some of them arranged in some kind of sequences. For example, there is a group of jobs with only: [‘branches’] that triggers after every push for a branch. Another group has only: [‘tags’] and responsible for a tag building. Third group has except property and responsible for specific tag building. All these jobs mixed in one file and it is really hard to read and understand the file.
I would like to have different files for each pipeline/flow. It seems I should use workflow keyword, but I haven’t found an example how it should be used.
Can I have .gitlab-ci.yml just as include list where each included file has workflow definition with rules, stages and specific jobs?
include: - local: '/merge-request.yml' - local: '/build-specific-branch-on-push.yml' - local: '/qa-tag-build.yml' - local: '/production-tag-build.yml'
workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" stages: - restore-dependencies - build - unit-tests ...jobs...
Is it possible?