runixo
runixo

Reputation: 323

Problems deploying Firebase Functions from Google Cloud Build

The instructions to deploy 'hosting' seemed to be super simple, just:

args: ['deploy', '--project=project-id', '--only=hosting']

Now, I wanted to deploy hosting and functions, so I stripped the '--only=hosting' but this failed because:

Upvotes: 1

Views: 67

Answers (1)

runixo
runixo

Reputation: 323

This is the cloudbuild.yml I ended up using to deploy my firebase function using google cloud build:

steps:
  - name: gcr.io/XXX/firebase
    env:
      - ENV1=1
    args:
      - '-c'
      - |
        set  &&
        env | grep -E "ENV1|SECRETENV" > functions/.env &&
        python3 -m venv functions/venv &&
        . functions/venv/bin/activate &&
        python -m pip install -r functions/requirements.txt &&
        firebase deploy --project=XXXX
    dir: blah
    entrypoint: /bin/bash
    secretEnv:
      - SECRETENV
timeout: 600s
availableSecrets:
  secretManager:
    - versionName: projects/XXX/secrets/XXXX/versions/latest
      env: SECRETENV

Upvotes: 0

Related Questions