How To Deploy Angular 2 App On Github For Free








At First Install angular-cli ghpages


npm install -g angular-cli-ghpages
 
 
After installing next step is linking your repository. Run this command
 
ng build --prod --base-href "https://<user-name>.github.io/<repo>/" 
 
If You See Error Then ommit --prod and Run This Command
 
 
ng build --base-href "https://<user-name>.github.io/<repo>/" 
 
 
You can now see a dist folder in your angular 2 app directory. 
Upload all files of dist folder on github repository. 
Then From Settings Enable Github Pages. A link will be provided to you.
That's It.

Demo : https://shawon100.github.io/angularmaterial/
 
 
 
Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment