Henry Falade
Jun 25 · 1 min read

Hello Rezaasgarirr,

The deployment blocks are like event listeners. You can add more than one block, then set the branch they should listen to. Check below:

deploy_staging:
type: deploy
environment:
name: stage
url: http://developer.com
script:
- ssh root@developer.com "cd var/www/ && git checkout developer && git pull origin developer && exit"
only:
- developer

deploy_production:
type: deploy
environment:
name: production
url: http://mainsite.com
script:
- ssh root@mainsite.com "cd var/www/ && git checkout master && git pull origin master && exit"
only:
- master

I hope this helps.
Please fell free to ask if you need more clarification tho.

    Henry Falade

    Written by

    A programmer and web tech enthusiast! Love Angular & Laravel.