How to use Environment secrets in github actions workflow for different env like staging and production

23 Views Asked by At
runs-on: ubuntu-latest

steps:
  - name: Checkout code
    uses: actions/checkout@v2

  - name: Google Auth
    id: auth
    uses: 'google-github-actions/auth@v2'
    with:
      ENVIRONMENT: staging
      credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

using Environment secrets and not Repository secrets as the key names will be the same just env will be different as key values will differ based on env.

enter image description here

0

There are 0 best solutions below