In the tutorial, we show you how to deploy Angular application on GitHub Page.
Related post:
– Angular 6 dynamic Navigation Bar – add/remove Route dynamically
Contents
Technology
– GitHub
– Angular
Practice
Create GitHub Repository
Login to your GitHub account, example grokonez@gmail.com
, then create a GitHub repository with name: angularapp
Install angular-cli-ghpages
Use below CMD to install angular-cli-ghpages
->
npm install -g angular-cli-ghpages
Build Angular Project
Using below cmd to build Angular Project:
ng build --prod --output-path githubrepository --base-href "https://grokonez.github.io/githubrepository/"
-> Details:
ng build --prod --output-path angularapp --base-href "https://grokonez.github.io/angularapp/"
-> Results:
Publish the Application on GitHub
Add the repository angularapp as a remote file to the local project:
$git init $git remote add origin https://github.com/grokonez/angularapp.git |
-> Verify by cmd: git remote -v
In Angular project folder, use ngh --dir=angularapp
to publish the application on GitHub page:
Navigate to https://
to see web-app: