|
1 | 1 | # angular-cli-ghpages
|
2 | 2 |
|
3 | 3 | Angular CLI addon. Publish to any gh-pages branch on GitHub (or any other branch on any other remote).
|
4 |
| -This is __NOT__ [angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages). |
| 4 | +This is __NOT__ [IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages) - but inspired by it. |
5 | 5 |
|
6 | 6 | ## WHY?
|
7 | 7 |
|
8 |
| -angular-cli-github-pages is fixed to the `gh-pages` branch of the same repository. |
9 |
| -We don't like this. So this addon pushes to any branch on any repository. It also does not require SSH to be set up. This works perfectly for Travis-CI. |
| 8 | +[IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages) is fixed to the `gh-pages` branch of the same repository. In my oponion it is also trying to do too much. |
| 9 | +In contrast to this, the [Angular2Buch/angular-cli-ghpages](https://github.com/Angular2Buch/angular-cli-ghpages) addon is much more simple. It pushes to any branch on any repository, by utilizing [tschaub/gh-pages](https://github.com/tschaub/gh-pages). Nothing more. |
| 10 | +This addon works perfectly on Travis-CI. |
10 | 11 |
|
11 | 12 | ## Installation & Setup
|
12 | 13 |
|
13 | 14 | This addon has the following prerequisites:
|
14 | 15 |
|
15 |
| -- Node.js 4.x |
16 |
| -- Angular project created via [angular-cli](https://github.com/angular/angular-cli) |
| 16 | +- Node.js 4.x |
| 17 | +- Git 1.7.6 or higher |
| 18 | +- Angular project created via [angular-cli](https://github.com/angular/angular-cli) |
17 | 19 |
|
18 |
| -To install this addon all you need to do is install angular-cli-github-pages via npm: |
| 20 | +To install this addon all you need to do is install `angular-cli-github-pages` via npm: |
19 | 21 |
|
20 | 22 | ```sh
|
21 |
| -npm install --save-dev angular-cli-ghpages |
| 23 | +npm i angular-cli-ghpages --saveDev |
22 | 24 | ```
|
23 | 25 |
|
24 | 26 | ## Usage
|
25 | 27 |
|
26 |
| -Once that's done, you can checkout the branch you want to create the gh-page |
27 |
| -from (likely master) and run the command to build and commit it. |
| 28 | +Run `ng build` to fill the `dist` folder. |
| 29 | +Then execute `ng ghpages` in order to deploy it. |
28 | 30 |
|
29 |
| -Then run `ng ghpages` in order to deploy it. |
| 31 | +Usage: |
30 | 32 |
|
31 | 33 | ```sh
|
32 |
| -ng build |
33 |
| -ng ghpages XXX |
| 34 | +ng build --environment=production |
| 35 | +ng ghpages [OPTIONS] |
34 | 36 | ```
|
35 | 37 |
|
| 38 | +## Options |
| 39 | + |
| 40 | +#### <a id="repo">--repo</a> |
| 41 | + * optional |
| 42 | + * default: url of the origin remote of the current dir (assumes a git repository) |
| 43 | + |
| 44 | +By default, [tschaub/gh-pages](https://github.com/tschaub/gh-pages) assumes that the current working directory is a git repository, and that you want to push changes to the `origin` remote. If instead your script is not in a git repository, or if you want to push to another repository, you can provide the repository URL in the `repo` option. |
| 45 | + |
| 46 | +#### <a id="message">--message</a> |
| 47 | + * optional |
| 48 | + * default: `Auto-generated commit` |
| 49 | + |
| 50 | +The commit message, __must be wrapped in quotes__. |
| 51 | +Hardcoded additional text is always added, if the environment variable `process.env.TRAVIS` exists (for Travis CI). |
| 52 | + |
| 53 | +Example: |
| 54 | +```sh |
| 55 | +ng ghpages --message "What could possibly go wrong?" |
| 56 | +``` |
| 57 | + |
| 58 | + |
| 59 | +#### <a id="branch">--branch</a> |
| 60 | + * optional |
| 61 | + * default: `gh-pages` |
| 62 | + |
| 63 | +The name of the branch you'll be pushing to. The default uses GitHub's `gh-pages` branch, but this can be configured to push to any branch on any remote. |
| 64 | + |
| 65 | + |
| 66 | +#### <a id="name">--name & --email</a> |
| 67 | + * optional |
| 68 | + * default: value of `git config user.name` and `git config user.email` |
| 69 | + |
| 70 | +If you are running the command in a repository without a `user.name` or `user.email` git config properties (or on a machine without these global config properties), you must provide user info before git allows you to commit. In this case provide both `name` and `email` string values to identify the committer. |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
36 | 76 | ## License
|
37 | 77 | Code released under the [MIT license](https://opensource.org/licenses/MIT).
|
0 commit comments