Deploy to GitHub Pages
Last updated
Last updated
To deploy our changes to GitHub pages we will use the angular-cli-ghpages
package
You need to install angular-cli-ghpages
You need to save the changes you made in the project
Run the deploy command
angular-cli-ghpages
We'll use an Angular CLI command to add this library to our app and automatically configure the deploy action. Run the following command:
Commit your changes made by adding angular-cli-ghpages
by running this command in your project directory.
Then run the following command to push the changes
Run:
π‘ /[your-repo-name]/
is a placeholder for your github repository name. So if you project has the name https://github.com/myname/ng-girls
the value has to be: --base-href="/ng-girls/"
.
Your app will be available at https://[your-GH-username].github.io/[repo-name]/
If deploy succedeed but you see blank page in browser you probably used capitalized letters in your repository name. Try to add new repository with only lowercase letters from GitHub website. Later on remove connection to old one from your local files by typing:
in terminal. Add connection to new repository
And build website again:
On (windows) machines you might run into an issue like the following:
Try to debug it with angular-cli-ghpages -S
. If you get the following error:
you can do the following
Run the following command and replace your token, organization (your user), repository, username and email:
For more information see .
Create a Personal Access Token here: