How to deploy an Ionic or Angular build for “FREE”
follow this for building ionic app
One time steps
Step-1 Create Firebase account and project
- go to https://console.firebase.google.com/ and log in with a google account.
- Click on create a Project
- Enter equivalent name
- finish the project creation
Step-2 Install Firebase tools and Login to Firebase
- Create a folder somewhere (say “deploy”), open the terminal, and cd to the folder
- Install firebase tools using
npm install -g firebase-tools
- Now you need to login into firebase-CLI, by using the command firebase login, You need to give it a few permissions, and CLI will forward you to the login page, you’ll get the link for the same in the terminal also. then just Login into your google account.
- Once login is successful. do the initialization in the command line
firebase init
- Now copy the zip (say
dist.zip
todeploy
folder) Unzip the file and you will getdist
folder
Step-3 Firebase Init
- perform
firebase init
command in the samedeploy
folder - it’ll list five services provided by firebase Database, Firestore, Functions, Hosting, Storage. You have to scroll down to Hosting by the down arrow key and select by space key. you can also select other services if you’re using them or use them in the future.
Then firebase-CLI will ask you to select the project name, that you created in step 1.
The CLI will ask you What do you want to use as your public directory? , here you need to provide the folder for your angular build files.. in the current case, it will be www
Everytime Deploy steps
Now that you have done the setup deploying is super simple — just run firebase deploy
in command line
you will get the deployed link.
IF you wish to change the deployment from global to domestic just change the folder portal
with the new deployment's content(or unzip and rename the folder with a name www
) and perform firebase deploy
you will get the new build hosted automatically for you.