Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to inject env variables through .env file creation #85

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/firebase-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,22 @@ on:
required: false
type: string
default: ''
workingDirectory:
description: 'The workingDirectory of the GitHub Action. Defaults to $GITHUB_WORKSPACE'
required: false
type: string
default: '.'
secrets:
GOOGLE_APPLICATION_CREDENTIALS_BASE64:
description: |
The Base64 version of the private key JSON file for the service account.
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
ENV_FILE:
description: |
.env file that is injected in the build context before doing the firebase deployment.
required: false

jobs:
deployfirebase:
Expand All @@ -75,6 +84,12 @@ jobs:
java-version: '17'
- name: Install Firebase CLI Tools
run: npm install -g firebase-tools
- name: Create .env file
env:
env-file: ${{ secrets.ENV_FILE }}
if: ${{ env.env-file != '' }}
run: |
echo "${{ env.env-file }}" > ${{ inputs.workingDirectory }}/.env
- name: Run custom command
if: ${{ inputs.customcommand != '' }}
run: ${{ inputs.customcommand }}
Expand Down
Loading