You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A detailed changelog is available in the [releases](https://github.com/angular-schule/angular-cli-ghpages/releases) section.
40
40
41
-
**⚠️ BREAKING CHANGE (v1)**
41
+
**⚠️ BREAKING CHANGE (v2)**
42
42
43
-
Starting with version 1 the option `--configuration` was renamed to `--build-target`.
43
+
The internal build of Angular has changed with Angular 17.
44
+
Unfortunately, there are now a lot of different _build targets_ and builders.
45
+
We will try to guess the correct build target, based on the usual conventions to name them.
46
+
The conventions are shown below, try to specify the build target more and more explicitly until the project compiles.
44
47
45
-
BEFORE (_does not work_):
48
+
In the following example, your app is called `test` and you want to deploy the `production` build.
46
49
47
-
```
48
-
ng deploy --configuration=test
50
+
```bash
51
+
ng deploy
49
52
```
50
53
51
-
NOW:
54
+
If this doesn't work, try this:
52
55
53
-
```
56
+
```bash
54
57
ng deploy --build-target=test
55
58
```
56
59
57
-
If you use the old syntax, you will probably receive the following error:
60
+
If this doesn't work, try this:
58
61
59
-
> An unhandled exception occurred: Configuration 'test' is not set in the workspace.
62
+
```bash
63
+
ng deploy --build-target=test:build:production
64
+
```
60
65
61
-
<br>
66
+
You can also and modify your `angular.json` to archive the same:
62
67
63
-
**🐙 GitHub Actions** is now properly supported alongside Travis CI and CircleCi. The token `GITHUB_TOKEN` is also supported. Learn everything you need to know in the following article:
68
+
```json
69
+
{
70
+
"deploy": {
71
+
"builder": "angular-cli-ghpages:deploy",
72
+
"options": {
73
+
"buildTarget": "test:build:production"
74
+
}
75
+
}
76
+
}
77
+
```
78
+
79
+
For your convenience, you can also use `prerenderTarget` (which adds the suffix `:prerender:production`).
80
+
There is no support for `universalBuildTarget` or `serverTarget` because Github Pages only supports static assets and no Server-Side Rendering!
81
+
82
+
We will then try to deploy the `dist/test/browser` folder to Github Pages.
83
+
If this is not the folder that you want to serve, you should explicitly specify the directory with the `--dir` option:
84
+
85
+
```bash
86
+
ng deploy --dir=dist/test/browser
87
+
```
64
88
65
-
**[Everything GitHub: Continuous Integration, Deployment and Hosting for your Angular App](https://angular.schule/blog/2020-01-everything-github)**
89
+
This new build logic is a breaking change, therefore `angular-cli-ghpages` v2 only supports Angular 17 and higher.
90
+
For previous versions of Angular, use `angular-cli-ghpages` v1.x.
66
91
67
92
## ⚠️ Prerequisites <aname="prerequisites"></a>
68
93
69
94
This command has the following prerequisites:
70
95
71
96
- Git 1.9 or higher (execute `git --version` to check your version)
72
-
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli)v9.0.0 or greater
73
-
- older Angular projects can still use the standalone program. See the documentation at [README_standalone](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_standalone.md).
97
+
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli)v17 or greater
98
+
- older Angular projects can still use a v1.x version or use the standalone program. See the documentation at [README_standalone](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_standalone.md).
@@ -165,11 +190,6 @@ ng deploy --repo=https://github.com/<username>/<repositoryname>.git --name="Your
165
190
166
191
(replace `<username>` and `<repositoryname>` with your username from GitHub and the name of your repository)
167
192
168
-
> **⚠️Important**
169
-
>
170
-
> Please **do not disable the silent mode** if you use tokens, otherwise people could read them in the output logs.
171
-
> If you are sure that your CI/CD provider does not display secrets on the console (this applies to CircleCI / Travis CI and Github Actions), you are welcome to disable silent mode.
172
-
173
193
> **ℹ️ Note for GitHub Actions**
174
194
>
175
195
> The `GITHUB_TOKEN` (installation access token) will only trigger a release of a new website if the action runs in a private repository. In a public repo, a commit is generated, but the site does not change. See this [GitHub Community post](https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/m-p/26869) for more info. If your repo is public, you must still use the `GH_TOKEN` (personal access token).
@@ -304,43 +324,44 @@ If you run the command in a repository without `user.name` or `user.email` Git c
304
324
you must provide user info before Git allows you to commit.
305
325
In this case, provide **both**`name` and `email` string values to identify the committer.
306
326
307
-
#### --no-silent <aname="no-silent"></a>
327
+
#### --no-dotfiles <aname="no-dotfiles"></a>
308
328
309
329
-**optional**
310
-
- Default: silent `true`(boolean)
330
+
- Default: Dotfiles are created (boolean`true`)
311
331
- Example:
312
-
-`ng deploy` – Logging is in silent mode by default.
-`ng deploy --no-dotfiles` – Dotfiles are ignored.
314
334
315
-
Logging is in silent mode by default.
316
-
In silent mode, the error messages for git operations are always sanitized.
317
-
(The message is always: `'Unspecified error (run without silent option for detail)'`)
335
+
The command includes dotfiles by default (e.g. `.htaccess` will be committed).
336
+
With `--no-dotfiles` files starting with `.` are ignored.
318
337
319
-
The `--no-silent` option enables detailed error messages and extended console logging.
320
-
Keep this untouched if the repository URL or other information passed to git commands is sensitive!
338
+
#### --no-notfound <aname="no-notfound"></a>
321
339
322
-
> **⚠️ WARNING**
323
-
>
324
-
> This option should be kept as it is if the repository URL or other information passed to Git commands is sensitive and should not be logged (== you have a public build server and you are using the token feature).
325
-
> By default the silent mode is enabled to avoid sensitive data exposure.
340
+
-**optional**
341
+
- Default: `404.html` file is created (boolean `true`)
342
+
- Example:
343
+
-`ng deploy` – A `404.html` file is created by default.
344
+
-`ng deploy --no-notfound` – No `404.html` file is created.
326
345
327
-
#### --no-dotfiles <aname="no-dotfiles"></a>
346
+
By default a `404.html` file is created, because this is the only known workaround to avoid 404 error messages on GitHub Pages.
347
+
For Cloudflare Pages we highly recommend to disable the `404.html` file by setting this switch to true! see [#178](https://github.com/angular-schule/angular-cli-ghpages/issues/178)
348
+
349
+
#### --no-nojekyll <aname="no-nojekyll"></a>
328
350
329
351
-**optional**
330
-
- Default: dotfiles `true`(boolean)
352
+
- Default: `.nojekyll` file is created (boolean`true`)
331
353
- Example:
332
-
-`ng deploy` – Dotfiles are included by default.
333
-
-`ng deploy --no-dotfiles` – Dotfiles are ignored.
354
+
-`ng deploy` – A `.nojekyll` file is created by default.
355
+
-`ng deploy --no-nojekyll` – No `.nojekyll` file is created.
334
356
335
-
The command includes dotfiles by default (e.g. `.htaccess` will be committed).
336
-
With `--no-dotfiles` files starting with `.` are ignored.
357
+
By default a `.nojekyll` file is created, because we assume you don't want to compile the build again with Jekyll.
337
358
338
-
**Hint:**
339
-
This is super useful if you want to publish a `.nojekyll` file.
340
-
Create such a file in the root of your pages repo to bypass the Jekyll static site generator on GitHub Pages.
359
+
**Explanation:**
360
+
By creating such a file in the root of your pages repo, you will bypass the Jekyll static site generator on GitHub Pages.
341
361
Static content is still delivered – even without Jekyll.
342
-
This should only be necessary if your site uses files or directories that start with **\_underscores** since Jekyll considers these to be special resources and does not copy them to the final site.
343
-
→ Or just don't use underscores!
362
+
But now the deployment will be a bit faster.
363
+
This is also necessary if your site uses files or directories that start with **\_underscores** since Jekyll considers these to be special resources and does not copy them to the final site.
364
+
The same applies to `.txt` files in your assets folder: They will just disappear if Jekyll processes the build. see [#160](https://github.com/angular-schule/angular-cli-ghpages/issues/160)
344
365
345
366
#### --cname <aname="cname"></a>
346
367
@@ -352,6 +373,15 @@ This should only be necessary if your site uses files or directories that start
352
373
A CNAME file will be created enabling you to use a custom domain.
353
374
[More information on GitHub Pages using a custom domain](https://help.github.com/articles/using-a-custom-domain-with-github-pages/).
354
375
376
+
#### --dir <aname="dir"></a>
377
+
378
+
-**optional**
379
+
- Default: `undefined` (string) – Conventions will be used to guess the correct directory in your `dist` folder.
Overrides the directory for all published sources, relative to the current working directory.
384
+
355
385
#### --dry-run <aname="dry-run"></a>
356
386
357
387
-**optional**
@@ -375,9 +405,11 @@ To avoid all these command-line cmd options, you can write down your configurati
375
405
- branch
376
406
- name
377
407
- email
378
-
- noSilent
379
408
- noDotfiles
409
+
- noNotfound
410
+
- noNojekyll
380
411
- cname
412
+
- dir
381
413
- dryRun
382
414
383
415
A list of all available options is also available [here](https://github.com/angular-schule/angular-cli-ghpages/blob/master/src/deploy/schema.json).
@@ -413,7 +445,7 @@ Now you can just run `ng deploy` without all the options in the command line!
413
445
We have seen `angular-cli-ghpages` running on various environments, like Travis CI, CircleCi or Github Actions.
414
446
Please share your knowledge by writing an article about how to set up the deployment.
415
447
416
-
1.[GitHub Actions](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_environment_github_actions.md) by [Dharmen Shah](https://github.com/shhdharmen)
0 commit comments