This is my Angular Website hosted on GitHub.
- Take a copy of my master branch.
- Test your changes locally.
- Make a pull request.
- I should then be able to test your changes locally and deploy them.
- Install node.js as it comes with npm.
- Run npm install -g angular-cli-ghpages. This will enable you to run the ngh command later.
- Inside your project inside angular.json set the outputPath to "dist/".
- Connect your local repository to the remote GitHub repository from where you want your repository to be hosted.
After I have once prepared my Angular application for deployment, I run the following commands inside the terminal whenever I want to deploy local changes. The terminal should of course be directed to the Angular application root directory.
- ng build --prod --base-href "https://simon-lammes.github.io/angular-app/" This creates a deployable application inside the dist folder of the project.
- ngh This pushes the deployable application inside the dist folder to the remote repository inside the gh-pages branch from where the site is hosted.