Search code examples
firebasefirebase-hostinggoogle-cloud-build

How to setup custom domain for firebase hosting using firebase cli on CloudBuild


I currently have a running CloudBuild pipeline where I deploy an app to firebase hosting.

cloudbuild.yaml:

// omitted text

- name: gcr.io/$PROJECT_ID/firebase
  args: ['deploy', '--project=$PROJECT_ID', '--only=hosting', '-m', 'Pipeline $BUILD_ID, committed by $_COMMIT_USER - $SHORT_SHA']

// omitted text

But I am unable to find out how to configure custom domain for the deployed app within the same cloudbuild.yaml or any other command-line way. on google docs, there is only a way to setup from firebase console.

any idea?


Solution

  • As far as I know there is currently no public API, nor a CLI command, to configure a custom domain name through Firebase Hosting. The only way to add a custom domain is indeed what you found, through the console.

    It's a valid feature request though, so I'd recommend filing a feature request with the support team and possibly also on firebase.uservoice.com.


    Also see: