forked from numericalshadow/numericalshadow.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·36 lines (33 loc) · 856 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
35
36
#!/bin/env bash
git checkout gh-pages
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" != "gh-pages" ]]; then
echo 'Aborting script, not on gh-pages branch';
rm -rf _site;
exit 1;
fi
rm _site -rf
git rm * -rf
git commit -m 'clean branch'
git checkout master
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" != "master" ]]; then
echo 'Aborting script, not on master branch';
rm -rf _site;
exit 1;
fi
docker-compose run jekyll /bin/bash -c 'jekyll build'
git checkout gh-pages
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$BRANCH" != "gh-pages" ]]; then
echo 'Aborting script, not on gh-pages branch';
rm -rf _site;
exit 1;
fi
cp -r _site/* . && rm -rf _site/ && touch .nojekyll
echo "numericalshadow.org" >> CNAME
git add .nojekyll
git add *
git commit -m 'update built site'
git push -f
git checkout master