Can make one gitlab-ci.yml file for 3 different enviorment?

Hello All,
I’m trying to create one gitlab-ci.yml for 3 different environment (develop, pre-prod and prod) and there code is also in different branches. So could please help me that is this the right way to do or I need to create 3 different gitlab-ci.yml in all three branches?