Firebase has a service for hosting applications called Firebase Hosting. In this blog post, we will go through the steps in order to deploy our application to Firebase Hosting.
- Make sure that Firebase CLI is installed on your machine:
sudo npm install -g firebase-tools
. - Using Firebase CLI, log in to your account using the following command:
firebase login
. - Once authenticated, if you have not done so, go to your project’s root directory and build the application you wish to deploy.
- If you have done Steps 1 and 2 and Firebase CLI displays an authentication error, you might need to reauthenticate using the following command:
firebase login --reauth
. - Run the following command to deploy:
firebase deploy -m "insert commit message here" --only hosting
, where you can replace"insert commit message here"
with your own commit message.
Once your application has been successfully deployed, Firebase CLI will output the URL where you can navigate to your application.