title: Gitlab run a pipeline job when a merge request is merged
body: <p>I have a gitlab pipeline where there are two stages, one is build and the other one is deploy. The build stage is run when a commit is made. I want a way to run the deploy job when the merge request is merged to master. I tried several things but no luck. Can anyone help?</p>
  <pre><code>stages:
    - build
    - deploy
  
  dotnet:
  script: &quot;echo This builds!&quot;
  stage: build
  
  
  production:
  script: &quot;echo This deploys!&quot;
  stage: deploy
  
  only:
    refs:
      - master
  </code></pre>