travis ci

This commit is contained in:
2betop 2020-08-21 16:46:01 +08:00
parent e86cd69a89
commit 787220c068
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 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!');

View File

@ -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"