use deploy-to-gh-pages module

This commit is contained in:
Roman Hotsiy 2016-02-23 11:35:32 +02:00
parent f3d344fd37
commit 0133e6234e
4 changed files with 10 additions and 16 deletions

View File

@ -36,7 +36,7 @@ before_deploy:
deploy:
- skip_cleanup: true
provider: script
script: ./build/deploy_gh_pages.sh
script: npm run deploy
on:
branch: master
condition: $JOB != e2e

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -o pipefail
(
set -e
set -x
cd demo
git init
git config user.name "Travis-CI"
git config user.email "travis@travis"
cp -r ../dist ./dist
git add .
git commit -m "Deployed to Github Pages"
git push --force "https://${GH_TOKEN}@${GH_REF}" master:gh-pages 2>&1
) 2>&1 | sed "s/${GH_TOKEN}/xxPASSxx/"

6
build/prepare_deploy.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
set -x
cd demo
cp -R ../dist ./dist
cd -

View File

@ -14,7 +14,8 @@
"build-dist": "gulp build",
"branch-release": "git reset --hard && branch-release",
"unit": "gulp test",
"e2e": "gulp e2e"
"e2e": "gulp e2e",
"deploy": "build/prepare_deploy.sh && deploy-to-gh-pages demo"
},
"keywords": [
"Swagger",
@ -55,6 +56,7 @@
"branch-release": "^0.3.1",
"browser-sync": "^2.10.1",
"del": "^2.2.0",
"deploy-to-gh-pages": "^1.0.0",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-eslint": "^1.1.1",