Skip to content

Commit 7e8f2c6

Browse files
committed
Use gh-pages on TravisCI
1 parent d902744 commit 7e8f2c6

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

.angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"apps": [{
77
"root": "src",
8-
"outDir": "dist/demo",
8+
"outDir": "dist",
99
"assets": [
1010
"assets",
1111
"favicon.ico"

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ script:
2929
after_success:
3030
# Send coverage info off to cloud ppl
3131
- ./node_modules/.bin/codecov
32+
- npm run deploy

gh-pages.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const ghpages = require('gh-pages');
2+
const path = require('path');
3+
4+
ghpages.publish('dist', {
5+
repo: 'https://' + process.env.GH_TOKEN + '@github.com/' + process.env.TRAVIS_REPO_SLUG + '.git'
6+
}, function (err) {
7+
if (err) {
8+
console.log(err);
9+
} else {
10+
console.log('published gh-pages');
11+
}
12+
});

karma.conf.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ module.exports = function (config) {
4141
logLevel: config.LOG_INFO,
4242
autoWatch: true,
4343
browsers: ['Chrome'],
44-
singleRun: false
44+
singleRun: false,
45+
captureTimeout: 210 * 1000,
46+
browserDisconnectTolerance: 3,
47+
browserDisconnectTimeout: 210 * 1000,
48+
browserNoActivityTimeout: 210 * 1000
4549
});
4650
};

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
"test": "ng test",
1010
"test-coverage": "ng test --watch=false --code-coverage",
1111
"e2e": "ng e2e",
12-
"prebuild:lib": "rimraf tmp dist/lib",
13-
"build:lib": "gulp inline-templates && ngc -p tsconfig-lib.json && copyfiles package.json README.md LICENSE dist/lib",
14-
"postbuild:lib": "rimraf tmp",
15-
"prebuild:demo": "rimraf dist/demo",
16-
"build:demo": "ng build --prod",
17-
"pub:lib": "npm run build:lib && npm publish dist/lib",
18-
"pub:demo": "npm run build:demo -- --base-href /ngx-treeview/ && gh-pages -d dist/demo",
19-
"pub": "npm run pub:lib && npm run pub:demo"
12+
"prebuild": "rimraf tmp dist",
13+
"build": "gulp inline-templates && ngc -p tsconfig-lib.json && copyfiles package.json README.md LICENSE dist",
14+
"postbuild": "rimraf tmp",
15+
"pub": "npm run build && npm publish dist",
16+
"predeploy": "rimraf dist",
17+
"deploy": "ng build --prod --base-href /ngx-treeview/ && node gh-pages.js"
2018
},
2119
"keywords": [
2220
"ng",

tsconfig-lib.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compileOnSave": false,
33
"compilerOptions": {
44
"baseUrl": ".",
5-
"outDir": "./dist/lib/src",
5+
"outDir": "./dist/src",
66
"target": "es5",
77
"module": "es2015",
88
"moduleResolution": "node",
@@ -25,4 +25,4 @@
2525
"skipTemplateCodegen": true,
2626
"strictMetadataEmit": true
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)