title: How to set env vars for many deployment environments while using github actions
body: <p>I need to use github actions for deploying my stack to many environments, e.g., <code>development</code> and <code>production</code>. My prior implementation won't work anymore, and whilst I have a new working workflow, setting env vars for multiple envs seems repetitive and makes me think there must be a better way.</p>
  <p>What I had before:</p>
  <pre><code>jobs:
    build-and-deploy:
      name: Build Container and Deploy
      runs-on: ubuntu-latest
      steps:
        - name: Set env to development
          if: ${{ !endsWith(github.ref, '/main') }}
          run: |
            echo &quot;GCP_PROJECT=my-project-dev&quot; &gt;&gt; $GITHUB_ENV
            echo &quot;NODE_ENV=development&quot; &gt;&gt; $GITHUB_ENV
  
        - name: Set env to production
          if: ${{ endsWith(github.ref, '/main') }}
          run: |
            echo &quot;GCP_PROJECT=my-project-prod&quot; &gt;&gt; $GITHUB_ENV
            echo &quot;NODE_ENV=production&quot; &gt;&gt; $GITHUB_ENV
      ...
  
  </code></pre>
  <p>What I have now:</p>
  <pre><code>jobs:
    build-and-deploy:
      name: Build Container and Deploy
      runs-on: ubuntu-latest
      env:
        GCP_PROJECT: ${{ (!endsWith(github.ref, '/main') &amp;&amp; 'my-project-dev') || 'my-project-prod' }}
        NODE_ENV: ${{ (!endsWith(github.ref, '/main') &amp;&amp; 'development') || 'production' }}
      steps:
      ...
  </code></pre>
  <p>Obviously, it doesn't seem so bad in the example, but for many more env vars the <code>${{ (!endsWith(github.ref, '/main') &amp;&amp; 'dev-value') || 'prod-value' }}</code> seems noisy and dirty.</p>
  <p>So, what would be the proper way for doing this?</p>