Browse Source

add travis

pull/9/head
tangjinzhou 7 years ago
parent
commit
18efe2729d
  1. 1
      .gitignore
  2. 9
      .travis.yml
  3. 28
      scripts/deploy-to-gh-pages.sh
  4. 2
      webpack.prod.config.js

1
.gitignore vendored

@ -58,3 +58,4 @@ typings/
.env
.idea
.DS_Store
dist/

9
.travis.yml

@ -11,15 +11,8 @@ deploy:
keep-history: true
on:
branch: master
before_script:
- git checkout origin/gh-pages
- git rebase master
script:
- npm run build
after_success:
- git add --all .
- git commit -m "travis ci auto build"
- git push --force origin gh-pages
- bash ./scripts/deploy-to-gh-pages.sh
env:
matrix:
secure: PBbJaS48HA/mkj9PuGuRxs00DEJR77XfuPdSlTvCq0QxLIR6wIO+t3LLJdOQctZIX6KWBR/Zq3zSn5bRxgPIaRcoyuEU25ga4cexJMEh1ymE23uTiDcnWwWN0X1jZKGuHPvqVKjyToAv6XW24mTXNvEAqD2uL101JxBseoWJ/2VtyOjJFJwcGbw+MTLymWCZiAF10w+k0SyigawaxZLlYL9LZXv4w3oCjCwuiTD/T6rvyT3wGQzXx7/P7XQGL4el4lE7leuK5m2PhWvX2S3t2FRpoZPw0DINJu5XzuBr3DSMErQjCrP4Ep8iqW8pGGLkoXbcxK3/K+uSy0k+DdBN7jRgnnOeLpqeVUSMaM6LRnl2XyDWL3dKpVbEzZaFkRTmAwdbgYjI+7Enn3/GtseMASo/gK47m2k+kE/msoqwpTGLC5DBOBKxdNShdFnEbOxLUUiVNgoZRXbj6VhdueqK89LsMDsnxzmFtrU8Ytgv8wJsFd5IkIhCStmQ9bdTqER659hd1Qqdh6Qe36AfpZcetOLr86Z++CSwA/pZbLPeEVrfCHDh6V3DPQXG+Zlf/m60OAmhosJ+4dxZwRnR8LnaDFZ+uLYMz+vJGeOtFHvczz7TW4mznjguLE51crG+mkBGT2dx1UUg7zs41lz3GtH9WY8cSG4y5ryjDl6YkXwoiZI=

28
scripts/deploy-to-gh-pages.sh

@ -0,0 +1,28 @@
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
if [[ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "false" ]]; then
echo "Starting to update gh-pages\n"
rm -rf dist
mkdir dist
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
./node_modules/.bin/webpack --config webpack.prod.config.js
cd dist
git init
git add -f .
git commit -m "Travis build"
git push --force --quiet https://${GITHUB_TOKEN}@github.com/vueComponent/ant-design.git master:gh-pages > /dev/null
echo "Done updating gh-pages\n"
else
echo "Skipped updating gh-pages, because build is not triggered from the master branch."
fi;

2
webpack.prod.config.js

@ -17,7 +17,7 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, './dist'),
publicPath: './dist/',
publicPath: './',
filename: '[name].[chunkhash].js',
chunkFilename: '[chunkhash].async.js',
},

Loading…
Cancel
Save