Last active
July 27, 2022 09:14
-
-
Save AtienoObwanda/a8af0086b7bbbd93b3b3630d385c9b72 to your computer and use it in GitHub Desktop.
Deploying an Angular App to Github pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying an Angular App to Github pages | |
Prerequisite: | |
A github account | |
A Github Repo | |
Deployment to gh-pages: | |
Create a Github repository for your project. | |
Push your code to the main branch | |
Create a gh-pages branch - This is an invaluable hack that will help us get the gh-pages link to help us set the base-href | |
Navigate to the settings of your Github repo to get the link to the published site | |
Back to your project locally add the angular-cli-ghpages | |
ng add angular-cli-ghpages | |
Then deploy your app using ng deploy command | |
ng deploy --base-href=your link to gh-pages | |
Note: replace your link to gh-pages with your actual link to gh-pages | |
UPDATED: If the App shows the README file, please navigate to the gh-pages setting on Github and ensure that the selected branch is gh-pages but not main or master. | |
References: | |
https://angular.io/guide/deployment#deploy-to-github-pages | |
npmjs package 'angular-cli-ghpages' | |
You may also like ⇒ Deploying Angular Apps to Netlify | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment