How to deploy angular project in github

This blog explain how to deploy angular project in your github repo and hosting it.

Here the example of how you can deploy angular project

How to deploy angular project in github
Note: hosting will be username.github.io/reponame/

Pushing code in github and hosting it in GitHub is fairly simple and straight forward.

Here is the step by step

  1. Install Git,ignore if you already have
  2. Create github account, ignore if you already have
  3. Push code in github
  4. Install angular-cli-ghpages
  5. deploy project in github

1.

If you don’t have git/git bash in your pc, make sure you install it in your pc from here.

2.

Create new account if you don’t have github account from this link

3.

Create new repo in your github and execute the following command in your cmd project directory.

This all code will make sure your code is push in github. You might have to login to GitHub while pushing.

4.

Now Install Angular CLI ghpages

5.

Deploy your angular project

That all, you should get your project with hosting by now.

Your project should be available at https://<username>.github.io/<repositoryname>.

Make sure you replace username with github username and repositoryname with your project repo. check here for more detail.

If you get any error while running your application check for your url request path and update with your github repo name.

Also read how to host static website in GitHub

Made with ❤

Leave a Comment

Your email address will not be published. Required fields are marked *