google-github-actions / deploy-appengine

A GitHub Action that deploys source code to Google App Engine.
https://cloud.google.com/appengine
254 stars 72 forks source link

env_vars input does not seem to take effect #360

Closed dustin-auby closed 7 months ago

dustin-auby commented 7 months ago

env_vars not received in node process

I have added in the env_vars input as shown in the docs but there are no values received by the node process. when testing localy with a env file or passing the variables directly there is no issue.

Expected behavior

App should receive the environment variables parsed into the yml config

Observed behavior

no vales are received in the nodejs process

Action YAML

# This is a basic workflow to help you get started with Actions

name: Deploy to GAE
# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the main branch
  push:
    branches: [ qa ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  deploy:
    name: Deploying to Google Cloud
    runs-on: ubuntu-latest
    environment: QA

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - id: 'auth'
      uses: 'google-github-actions/auth@v2'
      with:
        project_id: ${{ secrets.GCP_PROJECT }}
        credentials_json: ${{ secrets.GCP_CREDENTIALS }}

    - name: Deploy to App Engine
      id: deploy
      uses: 'google-github-actions/deploy-appengine@v2'
      with:
        env_vars: |-
          WEB_SOCKET_URL=${{ vars.WEB_SOCKET_URL }}
          BASE_URL=${{ vars.BASE_URL }}
          FIREBASE_API_KEY=${{ secrets.FIREBASE_API_KEY }}
          DB_HOST=${{ vars.DB_HOST }}
          DB_DATABASE=${{ vars.DB_DATABASE }}
          DB_USER=${{ secrets.DB_USER }}
          DB_SCHEMA=${{ vars.DB_SCHEMA }}
          DB_PASSWORD=${{ secrets.DB_PASSWORD }}
          DB_PORT=${{ vars.DB_PORT }}
          REDIS_HOST=${{ vars.REDIS_HOST }}
          REDIS_PORT=${{ vars.REDIS_PORT }}
          REDIS_DB=${{ vars.REDIS_DB }}
          REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}
          REDIS_USER=${{ secrets.REDIS_USER }}
          BQ_DATASET=${{ vars.BQ_DATASET }}
          BQ_LOCATION=${{ vars.BQ_LOCATION }}
        deliverables: app-dev.yaml
        project_id: ${{ secrets.GCP_PROJECT }}

    - name: Test
      run: 'curl "${{ steps.deploy.outputs.version_url }}"'

Log output

No response

Additional information

No response

sethvargo commented 7 months ago

Hi there - could you please provide the debug output for the complete GitHub Actions workflow run?

dustin-auby commented 7 months ago

Hi, so i eventually tried using the build_env_vars and that seems to work