Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Deploy to GitHub Pages

1. To begin, add the `angular-cli-ghpages` builder.

```bash
ng add angular-cli-ghpages
```

2. If you’re deploying the project to a Github project page you’ll need to set the `baseHref` property as the repository name. The `baseHref` will be used for all relative URLs on your site. You could specify the `baseHref` as part of the project architect deploy options in the `angular.json` file. Or just pass it as the `--base-href` flag to the `ng deploy` command. If you’re deploying the project to a Github user page, you do not need to set this option.

```bash
ng deploy --base-href=/<repository-name>/
```

GitHub will automatically enable Pages when you push a gh-pages branch. There is no need to enable Pages from the repository settings.

```bash
ng deploy --base-href=/ng-dev-testing/
```

* [Source](https://blog.bitsrc.io/deploy-your-angular-project-to-github-pages-7cbacb96f35b)
* [How to deploy a React, Angular and Vue project to Github pages](https://deepinder.me/how-to-deploy-a-react-angular-vue-project-to-github-pages)

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
19 changes: 11 additions & 8 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"AppDevTest": {
"ng-dev-testing": {
"projectType": "application",
"schematics": {},
"root": "",
Expand All @@ -16,7 +16,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/AppDevTest",
"outputPath": "dist/ng-dev-testing",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
Expand Down Expand Up @@ -69,18 +69,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "AppDevTest:build"
"browserTarget": "ng-dev-testing:build"
},
"configurations": {
"production": {
"browserTarget": "AppDevTest:build:production"
"browserTarget": "ng-dev-testing:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "AppDevTest:build"
"browserTarget": "ng-dev-testing:build"
}
},
"test": {
Expand Down Expand Up @@ -117,16 +117,19 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "AppDevTest:serve"
"devServerTarget": "ng-dev-testing:serve"
},
"configurations": {
"production": {
"devServerTarget": "AppDevTest:serve:production"
"devServerTarget": "ng-dev-testing:serve:production"
}
}
},
"deploy": {
"builder": "angular-cli-ghpages:deploy"
}
}
}
},
"defaultProject": "AppDevTest"
"defaultProject": "ng-dev-testing"
}
2 changes: 1 addition & 1 deletion e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('workspace-project App', () => {

it('should display welcome message', async () => {
await page.navigateTo();
expect(await page.getTitleText()).toEqual('AppDevTest app is running!');
expect(await page.getTitleText()).toEqual('Ng Dev Testing app is running!');
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/AppDevTest'),
dir: require('path').join(__dirname, './coverage/ng-dev-testing'),
subdir: '.',
reporters: [
{ type: 'html' },
Expand Down
Loading