I am using github repository for one of my java projects and I have following scenario to handle as part of CI/CD
- Push to
any branch- then compile and run unit tests - Push to
development branch- then compile and produce artifact. Deploy totest server - Push to
main branch- then compile and produce artifact. Deploy tostaging server
To handle the CI/CD, I can achieve in couple of ways that I can think of:
- Create a
single workflow ymland predicate the jobs based on the condition (More ofGitLabstyle of writing the CI file) - Create
multiple workflow ymland in each file use the condition to run
My question is: is it the good choice to write the workflow in multiple yml files as the actions/steps in the jobs are almost same and the differences can be handled via the env variables.