-
Notifications
You must be signed in to change notification settings - Fork 27
/
deploy.sh
34 lines (18 loc) · 656 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -o errexit -o nounset
rev=$(git rev-parse --short HEAD)
cd build
git clone -b gh-pages https://github.com/Ai-Thinker-Open/GPRS_C_SDK_DOC.git ./old
mv ./old/en ./en
rm -rf ./old
git init
git config user.name $GIT_NAME
git config user.email $GIT_EMAIL
git remote add upstream "https://[email protected]/Ai-Thinker-Open/GPRS_C_SDK_DOC.git"
# comment below because we don't need history of gh-pages, and use git push --force to cover history
# git fetch upstream
# git reset upstream/gh-pages
# echo "gprs.ai-thinker.com" > CNAME
git add -A
git commit -m "rebuild pages at ${rev}"
git push upstream HEAD:gh-pages --force