The Wayback Machine - https://web.archive.org/web/20240927195856/https://www.geeksforgeeks.org/how-to-deploy-angular-application-to-firebase-using-github/
Open In App

How to Deploy Angular Application to Firebase using GitHub ?

Last Updated : 16 Jun, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Many of us unable to showcase our small-scale or personal projects over the web. Since hosting these projects are a bit difficult and also costs a few bucks sometimes. In this article, we will show you how to deploy your Angular application at no cost without buying any domain or hosting provider. Also, tired of deploying your application every iteration? Let’s also set up automatic builds and deploys using GitHub.

Initialize Git and push the project to the GitHub repository

To configure automated builds and deployments to Firebase, the project must first be pushed to a GitHub repository. 

  • Open your project in Visual Studio Code.
  • Open Source control Menu from the sidebar or simply use this shortcut ( press Ctrl+Shift+G) to open.
  • Click on the Publish to GitHub button as shown below image.

Publish to GitHub

  • Enter the Repository Name as you desired and select the type of repository public or private.

  • Wait for VS Code to publish your project to GitHub.

Bundle Angular App for Production

By default, all angular projects are set for development so let’s build our project and generate our dist file.

  • Run the below command in your terminal of the project folder.
ng build --prod

  • Now after some time, the terminal generates a dist folder that is used for production and deploying.

Download Firebase and setup for deployment

The Firebase Command Line Interface (CLI) Tools can be used to test, manage, and deploy your Firebase project from the command line.

  • To download and install the Firebase CLI run the following command with the administrator right:
npm install -g firebase-tools
  • Now you’re supposed to login into your firebase with your google account using the following command in your project terminal:
firebase login

Create a Firebase project for deployment

  • Open the firebase website and go to your console by logging in through the link https://console.firebase.google.com
  • After logging in, click on the “Add Project” button, then enter your project name and click on the “Create Project” button to create your Firebase project.
  • Now it’s time for initializing firebase in your project using the following command in your project terminal.
firebase init
  • Firebase provides various services like Database, Firestore, Functions, Hosting, Storage. Scroll down and select Hosting by pressing the space key to select and then press the Enter button to proceed further.

  • After pressing enter, now the terminal asks to choose a project. Select the option “Use an existing project” and choose your project name of which you had created earlier pressing the enter key.

  • Now the terminal asks you to choose your public directory that contains Hosting assets to be uploaded with firebase deploy.
  • Enter the path of your dist folder which you had generated earlier which contains angular builds. In my case, it is dist/calc-angular

  • Now select Yes for the option Set up automatic builds and deploys with GitHub? 
  • Enter your GitHub user name and repository name in the format username/repository for the option “For which GitHub repository would you like to set up a GitHub workflow?”
  • For all other options just enter Yes or press enter key as you desired.
github1-copy-2

  • Once Firebase initialization is completed, just enter the following command in your terminal to deploy your project.
firebase deploy
  • Once the command is executed it provides an output with the link to the firebase project console and URL of the deployed project through which you can access your application through any device.

Now your Angular application is deployed with Firebase successfully.



Similar Reads

How to Deploy React App on Netlify Using Github?
React App is a web or mobile application that is built using the React library of JavaScript. It helps users create interactive, single-page, and dynamic applications. These applications are built using HTML, CSS, and JavaScript. Deployment of a React app can be done via GitHub, Netlify, or any other deployment platform. GitHub has its gh-pages, wh
6 min read
Deployment of Angular Application using Github Pages
There are various methods to deploy Angular Application such as Github Pages, Heroku, Firebase, etc. The Github provides the simplest way of all using the Github Pages. Steps to Create and Deploy Sample Angular Application to Github Pages: Install Node.js: a. Windows b. LinuxInstall Angular - CLICreate new project using Angular CLI: ng new gfg-exam
2 min read
How to Deploy React project on Firebase?
When developing any project we must host it somewhere so that the whole world can see our hard-work. Hosting websites can be hectic sometimes, but you don't need to worry as we can now host our React project on Firebase within a minute or two with a very simple setup.  The Steps to deploy react project on firebase are: Table of Content SetUp Fireba
2 min read
How to deploy Node.js app on Heroku from GitHub ?
In this article, we will be looking at how to deploy your Demo Node.js app to Heroku. At the end of this article, we will have a basic Hello World app running on a public domain that can be accessed by anyone. The Node must be installed on your machine. Refer to this article How to install Node on your machine.We are also going to use Github accoun
3 min read
How to Deploy Your React Websites on GitHub?
Building a web application is always exciting for developers especially when you step into the programming world for the first time. You build the front end of your application after a lot of struggle and you want to showcase your skill, your creativity, and of course your hard work to the world. Some of the folks might be familiar with the free ho
6 min read
Deploy MERN Stack on AWS EC2 with Docker via GitHub Actions
EC2 stands for Elastic Cloud Computing and is a service that AWS offers for running applications, hosting websites, processing data, and performing other computing operations. How will we deploy our MERN application?We will push our MERN project frontend and backend into two different repositories on GitHub from our local machine. After that, using
15+ min read
Firebase (sign in with Google) Authentication in Node.js using Firebase UI and Cookie Sessions
Firebase Authentication provides the backend services that are easy-to-use SDKs and ready-made UI libraries to authenticate users to your app. Prerequisites: Basic knowledge of node, JavaScript and firebase. Setup: First we need to create a Firebase Project, head over to firebase Console and create a new project. I am going to name it SignInWithGoo
4 min read
How to Update User's Profile After Signing Through GitHub using Firebase in Android?
In this article, we will learn to update user's profiles who signed in to the app through GitHub. The profile will be updated through the user's GitHub information like GitHub Id, name, followers, following, etc. Let's start! Step 1: First set up your app so that users can be signed in through GitHub. So you need to authenticate the user using GitH
7 min read
How to Upload Android APK to Testers Group in Firebase Using GitHub Actions?
Testing is always required whenever we build an app to ensure it functions properly in production. It might be time-consuming and inconvenient to send the application to the testers every time new code is merged into the codebase. So to solve this problem, CD pipelines can be used to deliver the software to the testers. In this article, we'll be le
3 min read
GitHub Authentication with Firebase
GitHub Authentication in Firebase allows users to sign in to our web application using their GitHub credentials. This integration uses GitHub's OAuth authentication system which provides a secure and convenient way for users to access your app. By integrating GitHub authentication, we can enhance user experience and speed up the sign-in process. In
5 min read
How to authenticate firebase with GitHub in ReactJS ?
The following approach covers how to authenticate firebase with GitHub in react. We have used the firebase module to achieve so. Creating React Application And Installing Module: Step 1: Create a React app using the following command: npx create-react-app gfgappStep 2: After creating your project folder i.e. gfgapp, move to it using the following c
3 min read
How to Upload a Project through GitHub Desktop on GitHub
GitHub Desktop is a user-friendly application that simplifies the process of managing your GitHub repositories on your local machine. If you’re looking to upload a project to GitHub using GitHub Desktop, this guide will walk you through the steps, making the process straightforward and accessible even for beginners. What is GitHub Desktop?GitHub De
3 min read
How to convert angular 4 application to desktop application using electron ?
Using Electron JS, we can convert our existing angular project into a desktop application very easily. In this post, we will create a sample Angular project and convert it into a Desktop application step by step. Prerequisites: NPM Must be installed Environment Setup: Install Angular CLI:npm install -g @angular/cliCreate a new Angular Project. Here
3 min read
How to Deploy Django application on Heroku ?
Django is an MVT web framework used to build web applications. It is robust, simple, and helps web developers to write clean, efficient, and powerful code. In this article, we will learn how to deploy a Django project on Heroku in simple steps. For this, a Django project should be ready, visit the following link to prepare one:https://www.geeksforg
4 min read
How to Deploy a Go Web Application with Docker?
Pre-requisite: Docker A popular containerization tool called Docker enables developers to quickly package programs and their environments, enabling shorter iteration times and greater resource efficiency while delivering the same intended environment each time. A container orchestration tool called Docker Compose makes it easier to meet the needs o
3 min read
Deploy Serverless Express Application to Vercel
Vercel is a serverless cloud-based hosting solution to host front-end and serverless applications. Express is a Node.JS framework and deploying serverless express application aids cost-cutting to nearly zero. Although the traditional way of deploying to the server is expensive and there is a limit on API calls plus you may need backend developers w
3 min read
How to deploy MERN application on Vercel ?
Vercel is a platform that caters to front-end developers by providing fast and dependable infrastructure to support the creation of innovative designs. With their services, teams can efficiently develop, preview, and deploy user-friendly interfaces. They offer support for over 35 front-end frameworks and seamlessly integrate with various headless c
4 min read
How do you deploy a React application?
Deploying a React application is the process of making your React project accessible on the internet so that users can interact with it. It involves several steps to ensure your application is properly built, uploaded to a hosting service, and configured to work correctly in a live environment. This process allows you to share your application with
2 min read
How To Deploy a Django Application to Heroku with Git CLI?
Deploying a Django application to Heroku using the Git command-line interface (CLI) is a simple process. Heroku provides a platform-as-a-service (PaaS) that enables you to deploy, manage, and scale your applications easily. This guide will walk you through the steps to deploy your Django application to Heroku using Git CLI. Deploying Django project
3 min read
How to Deploy Node.js Express Application on Render ?
Deploying a Node.js Express application on Render is straightforward and involves a few key steps to set up your project, configure deployment settings, and manage your application on the Render platform. Render provides an easy-to-use platform for deploying applications, offering features like automatic SSL, scaling, and seamless deployments from
4 min read
How To Deploy React Native Application on Play Store?
One of the most important advantages of using React Native is that it can generate applications for both Android and iOS operating systems. In this article, we will discover how to deploy a React Native app to the Play Store, and how to bundle all the files of the application and generate an AAB file. Steps to Deploy React Native ApplicationStep 1:
6 min read
How to Deploy an Express Application to Vercel ?
Vercel is a popular cloud platform that is known for its excellent support in building and deploying scalable Frontend infrastructure. In this article, we will look into how to deploy an Express.js web Application to Vercel. We will use the Serverless computing feature of Vercel to deploy our express.js application. PrerequisitesNode JS & NPM i
2 min read
Chat Application using React Hooks and Firebase
In the era of technology messaging apps have become an aspect of our everyday routines enabling us to engage and interact with others promptly. For developers interested in crafting their messaging app leveraging React Hooks in conjunction, with Firebase presents a strategy, for constructing a dynamic, responsive, and expandable chat system. This p
6 min read
How to Authenticate with Google using Firebase in React Native Application ?
In this article, we will discuss how can we authenticate with Google using Firebase in React Native. Creating React Application And Installing ModuleCreate a React app using the following command: npx react-native@latest init AwesomeProjectProject StructureNow install required npm packages: npm i @react-native-google-signin/google-signinnpm install
2 min read
Deployment of React Application using GitHub Pages
Deploying a React application using GitHub Pages is an easy and efficient way to host your projects online for free. In this article, we will walk you through the steps to deploy your React app, making it accessible to users with a live URL. PrerequisitesA GitHub accountNode.js and npm installedBasic knowledge of React and GitGitHub Pages is a stat
4 min read
How to use Azure Static Web Apps to Deploy an Angular App ?
In this article, we will learn how to deploy Angular applications using Azure Static Web Apps. Microsoft Azure: Microsoft Azure is a public cloud computing platform. It provides a lot of cloud services to access, manage, and deploy applications. Azure Static Web Apps: Azure Static Web App is one of the services of Microsoft Azure. It automatically
3 min read
Adding Angular Material Component to Angular Application
Angular Material provides Design Components for Angular. This is build and maintained by Angular Team. This provides the Angular developers with common UI components and tools to help build their own custom components. We as a user can integrate this with our Angular Application using the npm packages provided by them. Angular Material also provide
2 min read
How to Deploy Static Website using Caddy Webserver?
Caddy web server is an open-source web server written in Go. It uses the Go standard library for its HTTP functionality and supports HTTPS natively, which means it takes care of your SSL certificate management. In this article, we are going to deploy a static website to caddy webserver on a VPS. We will be using ubuntu PrerequisitesBasic Linux expe
5 min read
How to deploy a machine learning model using Node.js ?
In this article, we will learn how to deploy a machine learning model using NodeJS. While doing so we will make a simple handwritten digit recognizer using NodeJS and tensorflow.js. Tensorflow.js is an ML library for JavaScript. It helps to deploy machine learning models directly into node.js or a web browser. Training the Model: For training the m
5 min read
How to deploy web applications using Nginx on Remote server (Ubuntu based) - Set 2
In the last article, we got the idea about Nginx and how we can leverage its benefits, further we installed it on our device or remote server. In this article, we will see how to deploy a web application stored in the remote server using Nginx. We need to follow the given steps in order to deploy web applications using Nginx. Step 1: Open the termi
5 min read