This repository demonstrates the use of deployment using Github pages for Angular Application . The deployed application can be found here
- 🚀 Create new Angular Project (You can create one using angular-cli)
- 🔨 Now create the web-app according to your need, you can use angular-cli for code scaffolding
- 🚀 Create new Repo on Github
- 🗃️ Clone the git repo locally using :
git clone https://github.com/username/reponame.git
- Open terminal/command line (make sure you have git installed), make sure that you are in project directory
- Type the following commands to push the code on github:
git init
git add .
git commit -m "Initial Commit"
git remote add origin https://github.com/username/reponame.git
git push -u origin master
- Now, go to github repo and your code should be uploaded to master branch on github
- Next Install the angular-gh-pages using npm:
npm install -g angular-cli-ghpages
- Next, production build the angular application using:
ng build --prod --base-href "https://username.github.io/reponame/"
- Atlast, create the gh-pages branch, also upload the build and bundled code to this branch using :
ngh --dir dist/reponame
- 🥵 Now you application is successfully deployed using Github pages
- 🚀 You can find the link of deployed application in Settings Tab -> Github Pages
For more detailed steps for installation of angular-cli, git, etc. you can refer this article on Geeks for Geeks by me.