diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bdb97d78 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 10 +before_script: npm i +script: sh deploy-gh-pages.sh diff --git a/build/upload2cdn.js b/build/upload2cdn.js index f947001b..738683e7 100644 --- a/build/upload2cdn.js +++ b/build/upload2cdn.js @@ -3,8 +3,8 @@ const fs = require('fs'); const walk = require('fs-walk'); const path = require('path'); -const ak = process.argv[2]; -const sk = process.argv[3]; +const ak = process.env.BOS_AK; +const sk = process.env.BOS_SK; if (!ak || !sk) { console.error('ak and sk is required for deploy cdn!'); diff --git a/deploy-gh-pages.sh b/deploy-gh-pages.sh index cab53e00..e2efb297 100755 --- a/deploy-gh-pages.sh +++ b/deploy-gh-pages.sh @@ -4,7 +4,7 @@ set -e rm -rf gh-pages echo "Cloning" -git clone -b gh-pages https://github.com/baidu/amis.git gh-pages +git clone -b gh-pages https://$GH_TOKEN@github.com/baidu/amis.git gh-pages echo "building" node ./build/generate-search-data.js @@ -23,6 +23,6 @@ git config user.name "liaoxuezhi" git add . git commit --allow-empty -m "自动同步 gh-pages" -git push --tags https://github.com/baidu/amis.git gh-pages +git push --tags https://$GH_TOKEN@github.com/baidu/amis.git gh-pages echo "done"