diff --git a/.github/workflows/tf.yml b/.github/workflows/tf.yml index df36414..a33e9f5 100644 --- a/.github/workflows/tf.yml +++ b/.github/workflows/tf.yml @@ -28,18 +28,21 @@ jobs: # pull prod file if we are on main otherwise dev # GH Action error: Terraform lint and apply # changed 'google-github-actions/setup-gcloud@master' ---> 'google-github-actions/setup-gcloud@v0' - - uses: google-github-actions/setup-gcloud@v2 + - uses: google-github-actions/auth@v2 if: github.ref == 'refs/heads/main' with: service_account_key: ${{ secrets.SA_VARS_PROD }} export_default_credentials: false - - uses: google-github-actions/setup-gcloud@v2 + - uses: google-github-actions/auth@v2 if: github.ref != 'refs/heads/main' with: service_account_key: ${{ secrets.SA_VARS_DEV }} export_default_credentials: false + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' + - name: Get tfvars file if: github.ref == 'refs/heads/main' run: gsutil cp gs://${{ secrets.GCP_TFVAR_BUCKET_PROD }}/terraform.tfvars ./terraform.tfvars