How to deploy angular Application on Github Pages?

Saad Abbasi
1 min readApr 24, 2021

--

Do you want to deploy the angular application on GitHub pages? if yes then here is a step-by-step guide.

deploy angular Application on Github Pages

Here is Step by Step Guide How to Deploy the angular app to Github pages.

1) git init //for initializing git use cmd/shell hit Enter

2)git add . //add all files in git

3)git commit -m "first commit" // message for commit

4)git remote add origin "Your Remote Repository Url" // connecting to git repo

5)git push -u origin master // pushing to git repo

6)npm install -g angular-cli-pages //installing angular pages for deploy Angular project on github pages

7)ng build --prod --base-href="https://Username.github.io/github-Repo/" //production build ghpages

8*)Goto project folder after above steps completed there will be dist folder go inside dist>YOurProjectFolder-> move all files one level up.*

9)angular-cli-ghpages //deploying ghpages

10)goto GitHub repo setting scroll down there will be Github pages and link of your published repo click on that and BOOM Angular app is live on gh-Pages.

Originally answered here

--

--

Saad Abbasi
0 Followers

Hello 👋🏽 I am Saad Abbasi. A Full Stack Software Engineer with a Master's degree focused in Cs from the University of Azad Jammu and Kashmir.