Skip to content

Commit 23c14e0

Browse files
committed
update travis deploy settings
1 parent 80655c9 commit 23c14e0

File tree

5 files changed

+8670
-1202
lines changed

5 files changed

+8670
-1202
lines changed

Diff for: .travis.yml

+1-19
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,4 @@ after_success:
55
- npm run coveralls
66
script:
77
- npm test
8-
before_deploy:
9-
- NODE_ENV=production npm run build:examples
10-
env:
11-
global:
12-
- GITHUB_REPO: vkbansal/react-contextmenu
13-
deploy:
14-
provider: s3
15-
access_key_id: $AWS_ACCESS_KEY_ID
16-
secret_access_key: $AWS_SECRET_ACCESS_KEY
17-
bucket: aws-website-my-website-mr5h4
18-
local-dir: public
19-
upload-dir: react-contextmenu
20-
skip_cleanup: true
21-
default_text_charset: 'utf-8'
22-
detect_encoding: true
23-
on:
24-
tag: true
25-
branch: master
26-
repo: vkbansal/react-contextmenu
8+
- bash ./deploy.sh

Diff for: deploy.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#
3+
4+
echo $TRAVIS_BRANCH
5+
6+
if ([ "$TRAVIS_BRANCH" != "master" ] && [ -z "$TRAVIS_TAG" ]) || [ "$TRAVIS_PULL_REQUEST" != "false" ];
7+
then
8+
exit
9+
fi
10+
11+
set -o errexit
12+
13+
# build examples
14+
NODE_ENV=production npm run build:examples
15+
16+
cd public
17+
git init
18+
19+
git config --global user.name "Travis CI"
20+
git config --global user.email "${USER_EMAIL}"
21+
22+
git add .
23+
git commit -m "Deploy to gh-pages"
24+
25+
git push --force --quiet "https://${GITHUB_TOKEN}@github.com/vkbansal/react-contextmenu.git" master:gh-pages > /dev/null 2>&1

Diff for: examples/webpack.config.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const path = require('path');
55
const Extract = require('extract-text-webpack-plugin');
66
const HtmlWebpackPlugin = require('html-webpack-plugin');
77
const MinifyPlugin = require("babel-minify-webpack-plugin");
8-
const CompressionPlugin = require('compression-webpack-plugin');
98

109
const PROD = process.env.NODE_ENV === 'production';
1110
const DEV = !PROD;
@@ -91,11 +90,7 @@ PROD && config.plugins.push(
9190
'NODE_ENV': JSON.stringify('production')
9291
}
9392
}),
94-
new MinifyPlugin(),
95-
new CompressionPlugin({
96-
asset: '[path][query]',
97-
test: /\.(js|css)$/
98-
})
93+
new MinifyPlugin()
9994
);
10095

10196
module.exports = config;

0 commit comments

Comments
 (0)