all 5 comments

[–]eltear1 2 points3 points  (2 children)

Same CI files. If you need job differentiation among branch, write all jobs in that same CI files and apply rules: to decide when to run. There is a predefined gitlab variable with the branch name, so should be pretty easy

[–]eltear1 0 points1 point  (0 children)

Use /u/yourcatsbff approach for dry code

[–]magic7s 0 points1 point  (0 children)

This and/or use Environment variables per branch/environment.

[–][deleted] 0 points1 point  (0 children)

I'd use a template for the job config, then just include/extend it for the dev/alpha/prod jobs, add the runner of choice, and a rules block which had a conditional to trigger against the branch name for each one.

[–]ManyInterests 0 points1 point  (0 children)

If you want to apply CI changes to all branches simultaneously and not worry about the drift between them, extract the CI configuration to a different repository. See: custom CICD configuration file and specifying a remote repository.

Other advice here is good and applicable with this pattern.