travis ci

This commit is contained in:
2betop 2020-08-21 16:46:01 +08:00
parent ba982068af
commit cb4539533b
3 changed files with 9 additions and 4 deletions

5
.travis.yml Normal file
View File

@ -0,0 +1,5 @@
language: node_js
node_js:
- 10
before_script: npm i
script: sh deploy-gh-pages.sh

View File

@ -3,8 +3,8 @@ const fs = require('fs');
const walk = require('fs-walk'); const walk = require('fs-walk');
const path = require('path'); const path = require('path');
const ak = process.argv[2]; const ak = process.env.BOS_AK;
const sk = process.argv[3]; const sk = process.env.BOS_SK;
if (!ak || !sk) { if (!ak || !sk) {
console.error('ak and sk is required for deploy cdn!'); console.error('ak and sk is required for deploy cdn!');

View File

@ -4,7 +4,7 @@ set -e
rm -rf gh-pages rm -rf gh-pages
echo "Cloning" 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" echo "building"
node ./build/generate-search-data.js node ./build/generate-search-data.js
@ -23,6 +23,6 @@ git config user.name "liaoxuezhi"
git add . git add .
git commit --allow-empty -m "自动同步 gh-pages" 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" echo "done"