|
1 | 1 | # angular-cli-ghpages
|
2 | 2 |
|
| 3 | +<hr> |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +<hr> |
| 8 | + |
3 | 9 | Angular CLI addon. Publish to any gh-pages branch on GitHub (or any other branch on any other remote).
|
4 |
| -This is __NOT__ [IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages). Brought to you by the [angular2buch.de](https://angular2buch.de/) team! |
| 10 | +Made for Travis-CI. Brought to you by the [angular2buch.de](https://angular2buch.de/) team! |
5 | 11 |
|
6 | 12 | ## WHY?
|
7 | 13 |
|
8 |
| -[IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages) is limited to the `gh-pages` branch of the same repository. |
| 14 | +This is __NOT__ [IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages). That addon is limited to the `gh-pages` branch of the same repository. |
9 | 15 |
|
10 | 16 | In contrast to this, the [Angular2Buch/angular-cli-ghpages](https://github.com/Angular2Buch/angular-cli-ghpages) addon is able to push to any branch on any repository. It's build on top of [tschaub/gh-pages](https://github.com/tschaub/gh-pages).
|
11 |
| - |
12 |
| -__This addon works great on [Travis-CI](https://travis-ci.org/).__ |
| 17 | +__This addon works great on [Travis-CI](https://travis-ci.org/).__ No git credentials must be set up in before. Specific environment variables of Travis-CI are evaluated, too. |
13 | 18 |
|
14 | 19 | ## Installation & Setup
|
15 | 20 |
|
@@ -91,7 +96,27 @@ In example, the following command runs [on our Travis-CI](https://travis-ci.org/
|
91 | 96 | ng build --environment=production
|
92 | 97 | ng ghpages --repo=https:// [email protected]/Angular2Buch/book-monkey2-public.git --name= "The Buildbot" [email protected]
|
93 | 98 | ```
|
94 |
| -> REPO_USER_AND_PASS stores credentials in the format `username:password`. Special charcaters must be [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding). |
| 99 | +> REPO_USER_AND_PASS stores credentials in the format `username:password`. Special charcaters must be [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding). |
| 100 | +
|
| 101 | +### A hint for angular-cli |
| 102 | + |
| 103 | +Your build can break if `angular-cli` from package.json and the global `ng` command have different versions. |
| 104 | +You might want to define a run-script like this: |
| 105 | + |
| 106 | +```js |
| 107 | + "scripts": { |
| 108 | + "start": "ng server", |
| 109 | + "ng": "ng" |
| 110 | + } |
| 111 | +``` |
| 112 | + |
| 113 | +Now you can avoid a gloabl `ng` like this: |
| 114 | + |
| 115 | +```npm run ng -- ghpages --repo=https://XXX``` |
| 116 | + |
| 117 | +The special extra option `--` is used to delimit the end of the command. npm will pass all the arguments after the -- directly to your script. __Happy building!__ |
| 118 | + |
| 119 | + |
95 | 120 |
|
96 | 121 | ## License
|
97 | 122 | Code released under the [MIT license](https://opensource.org/licenses/MIT).
|
0 commit comments