title: How to set workflow env variables depending on branch
body: <p>I currently have two GitHub actions workflow files that are pretty much identical, only one is configured to react to push/pull_requests on branch <code>master</code> the other on <code>production</code>.</p>
  <p>The staging workflow starts like this:</p>
  <pre class="lang-yaml prettyprint-override"><code>env:
    GCLOUD_PROJECT: my-project-stg
    VERCEL_TARGET: staging
  
  on:
    push:
      branches: [ master ]
    pull_request:
      branches: [ master ]
  </code></pre>
  <p>The production workflow starts like:</p>
  <pre class="lang-yaml prettyprint-override"><code>env:
    GCLOUD_PROJECT: my-project-prd
    VERCEL_TARGET: production
  
  on:
    push:
      branches: [ production ]
    pull_request:
      branches: [ production ]
  </code></pre>
  <p>The rest of the workflow files is the same, so this is clearly not very DRY.</p>
  <p>I would like to have 1 single workflow file and somehow switch between two sets of variables based on the branch name. Is there a way to achieve this or am I maybe approach this from the wrong angle?</p>
  <p>If it were possible to extend both workflow files on a shared base definition that would also solve it I guess.</p>