Open In App

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:

ng new gfg-example
cd gfg-example




<h2 [ngStyle]="{'color':'#00FF00'}">
  Geeks For Geeks Example 
</h2>
  
<h3>
  Simple App Deployment using Github Pages
</h3>

npm start
git init
git add .
git commit -m "Initial Commit"
git remote add origin https://github.com/<username>/<reponame>.git
git push -u origin master
npm install -g angular-cli-ghpages
ng build --prod --base-href "https://<username>.github.io/<reponame>/"
ngh --dir dist/gfg-example
ngh --dir dist/<project-name>
Article Tags :