0
votes

Question

How can I deploy my Firebase site without erasing Cloud Functions.

  1. Maybe, include both site and cloud-functions in one deploy? What does that look like?
  2. Maybe, deploy the site without erasing cloud-functions? I don't find a firebase deploy --only site or similar

Context

I have a Firebase project that uses Cloud Functions. The code is in two folders:

-site-code
-cloud_function-code

When I want to deploy the project, I use firebase CLI tools, in two steps:

Step 1

from -site-code I run:

firebase deploy

Step 2

then from cloud_functions-code I run:

firebase deploy --only functions

Issue

When I run firebase deploy from -site-code, my Firebase Cloud Functions are deleted, so I must follow up with firebase deploy --only functions from -cloud_functions-code.

I did not find an --only directive for deploying just the site code from -site-code

2
Running firebase deploy --except functions will deploy just the site. As will firebase deploy --only hosting - Dan Getz
Alternatively to the two already mentioned: firebase deploy --only hosting, which would only deploy hosting. - Frank van Puffelen

2 Answers

5
votes

To only deploy your web site, use

firebase deploy --only hosting
3
votes

The Firebase CLI provides a way to deploy single functions as shown in its documentation:

firebase deploy --only functions:name_of_function