This project was generated with Angular CLI version 1.0.2.
See https://carmelc.github.io/angular-cli-example/dist/index.html for a running example.
There are two ways to be able to run an Angular static project as a Github Page:
-
Use the Master branch (shown in this example but considered as a 'dirty' way)
- Remove dist folder (or any other output folder used in runtime) from .gitignore file
- Run your build
- Push your changes
- make sure that the index.html file in your runtime folder (dist folder in this repo) does not define base ur in the section. If there is such definition, remove it. You can see how was it done in this commit
- In the repository Settings (top right of the page in github) in the GitHub Pages section, select master branch from the dropdown and click Save.
- Open https://{username}.github.io/{repo-name}/{path to index.html}/index.html
-
Create a dedicated branch called gh-pages
- Create a new branch called gh-pages (git checkout -b gh-pages)
- Delete content of .gitignore file (do not ignore any file)
- Delete all the sources from the main folder
- Copy the content of the products directory (e.g. dist in Angular CLI) into the main folder, make sure that the index.html file is in the root folder
- In the repository Settings (top right of the page in github) in the GitHub Pages section, select your branch from the dropdown and click Save.
- open https://{username}.github.io/{repo-name}