From 4c9650f3f4305d959a4d03f2e672fcc570f09362 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Fri, 6 Sep 2024 14:59:39 -0700 Subject: [PATCH] Add the Ability to Inject Environment Variables Signed-off-by: Paul Schmiedmayer --- .github/workflows/firebase-deploy.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index fcb588f..9853354 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -49,6 +49,11 @@ on: You can lean more about how to generate the JSON at https://cloud.google.com/iam/docs/service-accounts-create. The service account must have the minimally required permissions documented at https://firebase.google.com/docs/projects/iam/permissions. required: true + secrets: + ENV_FILE: + description: | + .env file that is injected in the build context before doing the firebase deployment. + required: false jobs: deployfirebase: @@ -75,6 +80,10 @@ jobs: java-version: '17' - name: Install Firebase CLI Tools run: npm install -g firebase-tools + - name: Load All Environment Variables + if: ${{ inputs.customcommand != '' }} + run: | + export $(${{ secrets.ENV_FILE }} | xargs) - name: Run custom command if: ${{ inputs.customcommand != '' }} run: ${{ inputs.customcommand }}