Back in the days there was a command in the Angular CLI named
ng ghpages. It was intended to provide a trival way of publishing the application generated with
ng. It was building the project, grabbing the contents of the
dist directory and pushing them to the
gh-pages branch of the repository. Then, the application was available online at
Because of unknown reasons (ok, not so uknown) it got removed from the Angular CLI:
@gkucmierz there were many reported issues with this command, so rather than ship the CLI with the issues it was decided to remove it, especially with some viable community alternatives.
The void was quickly filled with new tools that were performing the same task. One that is especially worth recommending is angular-cli-ghpages. I use it in my Go home, JS project and it works flawlessly. You can check it out yourself by visiting http://zbic.in/go-home-js.
What I would consider a good practice is creating an npm script that calls
ngh with all required parameters. You can go through all of the options yourself, to see what opportunities it gives. As a quick tl;dr example, a fragment of my
package.json looks as follows: