forked from daattali/beautiful-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpublish.sh
48 lines (37 loc) · 1.19 KB
/
publish.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
setup_git() {
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git remote rm origin
git remote add origin https://marcosbarbero:[email protected]/marcosbarbero/marcosbarbero.github.io.git
}
build_site() {
rm -rf _site/
bundle install
bundle exec jekyll build
}
fetch_n_checkout_branch() {
git fetch --all
git push origin --delete master
git branch -D master
git checkout develop
}
commit_n_push() {
git add --all
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
git subtree split --prefix _site -b master
# git push --quiet --set-upstream -f origin-pages master
git push -f origin master:master
}
# if [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [[ "$TRAVIS_COMMIT_MESSAGE" == *"[ci deploy]"* ]]; then
echo "***************************************************"
echo "BUILD STARTED"
echo "***************************************************"
build_site
setup_git
fetch_n_checkout_branch
cp CNAME _site/CNAME
commit_n_push
echo "***************************************************"
echo "BLOG RELEASED"
echo "***************************************************"
# fi