From 4c9650f3f4305d959a4d03f2e672fcc570f09362 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Fri, 6 Sep 2024 14:59:39 -0700 Subject: [PATCH 1/6] 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 }} From 40f8f766456ec5cc18c0df112b9186f5cd999b62 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Fri, 6 Sep 2024 21:08:22 -0700 Subject: [PATCH 2/6] Update firebase-deploy.yml Signed-off-by: Paul Schmiedmayer --- .github/workflows/firebase-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 9853354..3b0b083 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -49,7 +49,6 @@ 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. From abc59fcfff67993f8c905cb75af18be76e9a2a98 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 10 Sep 2024 10:37:21 -0700 Subject: [PATCH 3/6] Update firebase-deploy.yml Signed-off-by: Paul Schmiedmayer --- .github/workflows/firebase-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 3b0b083..8b3dd9b 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -80,7 +80,7 @@ jobs: - name: Install Firebase CLI Tools run: npm install -g firebase-tools - name: Load All Environment Variables - if: ${{ inputs.customcommand != '' }} + if: ${{ secrets.ENV_FILE != '' }} run: | export $(${{ secrets.ENV_FILE }} | xargs) - name: Run custom command From b61305cfda677b4025f839a74be310fb29074e65 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 10 Sep 2024 19:48:36 -0700 Subject: [PATCH 4/6] Update firebase-deploy.yml Signed-off-by: Paul Schmiedmayer --- .github/workflows/firebase-deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 8b3dd9b..1302710 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -80,7 +80,9 @@ jobs: - name: Install Firebase CLI Tools run: npm install -g firebase-tools - name: Load All Environment Variables - if: ${{ secrets.ENV_FILE != '' }} + env: + env-file: ${{ secrets.ENV_FILE }} + if: ${{ env.env-file != '' }} run: | export $(${{ secrets.ENV_FILE }} | xargs) - name: Run custom command From aef5d78b009d0df0c9bc978e1ab243dfc07503cd Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Tue, 10 Sep 2024 19:56:54 -0700 Subject: [PATCH 5/6] Update firebase-deploy.yml Signed-off-by: Paul Schmiedmayer --- .github/workflows/firebase-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 1302710..0af6f89 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -80,7 +80,7 @@ jobs: - name: Install Firebase CLI Tools run: npm install -g firebase-tools - name: Load All Environment Variables - env: + env: env-file: ${{ secrets.ENV_FILE }} if: ${{ env.env-file != '' }} run: | From d51d976d4085a3cc6d11785b89efbc407deb42ee Mon Sep 17 00:00:00 2001 From: Arkadiusz Bachorski <60391032+arkadiuszbachorski@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:19:54 +0200 Subject: [PATCH 6/6] Fix --- .github/workflows/firebase-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 0af6f89..a257c14 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -84,7 +84,7 @@ jobs: env-file: ${{ secrets.ENV_FILE }} if: ${{ env.env-file != '' }} run: | - export $(${{ secrets.ENV_FILE }} | xargs) + export $("${{ secrets.ENV_FILE }}" | xargs) - name: Run custom command if: ${{ inputs.customcommand != '' }} run: ${{ inputs.customcommand }}