2019-06-05 10:45:36 +08:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf gh-pages
|
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
echo "Cloning"
|
2020-10-26 18:39:20 +08:00
|
|
|
git clone -b gh-pages --depth=1 https://$GH_TOKEN@github.com/baidu/amis.git gh-pages
|
2020-11-03 13:27:41 +08:00
|
|
|
rm -rf gh-pages/*
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
echo "building"
|
2020-09-11 17:30:00 +08:00
|
|
|
node ./scripts/generate-search-data.js
|
2020-08-21 11:51:35 +08:00
|
|
|
|
2020-09-16 23:41:51 +08:00
|
|
|
npm run build-schemas
|
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
fis3 release gh-pages -c
|
|
|
|
|
2021-01-04 18:27:09 +08:00
|
|
|
# 拷贝一份兼容之前的访问路径
|
|
|
|
cp -r gh-pages/zh-CN/docs/* gh-pages/docs/
|
|
|
|
|
2020-09-16 23:41:51 +08:00
|
|
|
cp ./schema.json ./gh-pages
|
|
|
|
|
2021-01-14 11:03:11 +08:00
|
|
|
sh build.sh
|
|
|
|
|
|
|
|
tar -zcvf sdk.tar.gz sdk
|
|
|
|
|
|
|
|
mv sdk.tar.gz gh-pages/
|
|
|
|
|
2021-01-20 11:07:04 +08:00
|
|
|
# 加这个 github page 就不会忽略下划线开头的文件
|
|
|
|
touch gh-pages/.nojekyll
|
|
|
|
|
2020-08-27 11:11:50 +08:00
|
|
|
# 不走 cdn 了
|
2020-09-11 17:30:00 +08:00
|
|
|
# node ./scripts/upload2cdn.js $1 $2
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
echo "pushing"
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
cd gh-pages
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 16:19:26 +08:00
|
|
|
git config user.email "liaoxuezhi@icloud.com"
|
|
|
|
git config user.name "liaoxuezhi"
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-11-03 13:27:41 +08:00
|
|
|
git add . -A
|
2020-08-21 16:19:26 +08:00
|
|
|
git commit --allow-empty -m "自动同步 gh-pages"
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 16:46:01 +08:00
|
|
|
git push --tags https://$GH_TOKEN@github.com/baidu/amis.git gh-pages
|
2019-06-05 10:45:36 +08:00
|
|
|
|
2020-08-21 11:51:35 +08:00
|
|
|
echo "done"
|