Different deploy actions for different branches

Hello i want to do different actions for different branches during push.

For Example i want to deploy with dev branch to Testserver and with the master branch to the production server.

Is this possible with gitlab-runner?

And what is the best option.

my idea is to create a own gitlab-ci.yml file for developer branch but i am not sure?

Br Christian


You can do it all with a single .gitlab-ci.yml file using rules parameter:

In the job for the master branch, write:

    - if: '$CI_COMMIT_BRANCH == "master"'

In the job for for all other branches, write:

    - if: '$CI_COMMIT_BRANCH != "master"'

More at https://docs.gitlab.com/ee/ci/yaml/#rules.

1 Like

show I read your view I can,t give the answer but I am facing an issue in this topic https://modapkclub.com/mini-militia-god-mod-apk/ .please check this.