Type this into the terminal
ng build --prod --output-path docs --base-href PROJECT_NAME
- where PROJECT_NAME is the name of your project in GitHub. Make a copy of docs/index.html and name it docs/404.html.
- Commit your changes and push. On the GitHub project page, configure it to publish from the docs folder.