Steps to deploy the Angular build on Git Hub

Sometime we have to test our code on live while going to production, without buying any hosting to host your angular app you can test your angular app with git hub. you just need to map your repository with git pages , so i will show you step by step to deploy or run your angular application on git hub with buying any domain or hosting, just follow the steps below to deploy your build on GitHub's git pages. 


Step 1: Open angular project then run this command 
ng add angular-cli-ghpages
Step: 2: Build your project with this command this command will create a new folder "docs" for your project build. replace the roboangular with you git repository , here roboangular is my project repository
ng build --prod --output-path docs --base-href /roboangular/

Step: 3 Push you code to git . Run all commands individully
This command will add all the files to commit
git add .
this command add a commit with a message
git commit -m 'this is message for commit'
finally push your code to git
git push origin master
Step 4: Run this command to deploy your build on git.
ng deploy

Configure the Project Repository on Git Hub side.

Now open git hub with your login credentials.

Step 1: Go to your project repository and open it

Step 2: Click on setting 


Step 3: Scroll down till you see Git Pages.


Step 4: Open source drop down and then Select docs folder 

Step 5: open this link , if this is fist time you configuration this then the page of setting will refresh and then again scroll down to git pages and then click on this link .


Wait for a while then open the above link where your git repository is hosted.
Refresh the page if not seeing any change.

Comments