Setup:
1.You have an angular project.
2.Install angular-cli-ghpages package from npm like this
'npm install -g angular-cli-ghpages'
3. You can setup npm script like this or run directly in terminal:
"build-and-deploy-gh-pages": "ng build --prod --base-href ./ && npx ngh --dir dist/[reponame]"
Where ./ can be replaced with:
'https://[username].github.io/[reponame]/'
As a matter of fact, in above link you’ll find your github-page.
You’ll be asked for your github username and password to deploy to gihub pages.
This script will create gh-pages branch automatically and setup your repo for publishing online.
Next step would be to to run this script as: 'npm run build-and-deploy-gh-pages
Я написал статью в Medium о развертывании angular на страницах github.
Пожалуйста, посмотрите здесь