Closed irby closed 3 years ago
Figured out the solution. The reason was that while using the '&&' operator in the shell script isn't allowed, you can use a semicolon ';' and follow up the command this way. This will simultaneously set the environment variables and deploy the function
jobs:
deploy_function:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
# And of course we need to goto our functions folder to deploy
- name: Install npm packages
run: |
cd functions
npm install
# Update configs and deploy function to Firebase
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: functions:config:set ${{ secrets.FIREBASE_FUNCTIONS_ENV_VARIABLES }} ; firebase deploy --only functions
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: my-project
Hi all,
This issue is building off the commented in Issue #86
For some reason, I am unable to update my firebase function environment variables the YAML pipeline.
Here's my code:
I know it's kind of redundant to use the
firebase use
in the steps, but I figured it may have been the reason why my environment variables weren't setting. However, I was expecting that theSet environment variables
step would have updated the environment variables within themy-project
scope, but when I check out the .runtimeconfig.json within Google Cloud Functions, it's not any different than its value from my local environment.I've tried doing chaining the following, but it errors due to the Firebase CLI not being able to deploy after setting the environment variables:
Also, doing the following doesn't work either as it doesn't recognize the '&&' operand:
Is there a step to replacing the environment variables within the YAML code for my Firebase function? I feel like there is, I'm just missing where it would be done.