-
-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·29 lines (26 loc) · 657 Bytes
/
deploy
File metadata and controls
executable file
·29 lines (26 loc) · 657 Bytes
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
#!/bin/bash
set -e
set -x
DATE="$(date +%Y%m%d_%H%M%S)"
git tag "deploy-${DATE}"
git push --tags
rm -rf .cache public __deploy
yarn gatsby build
yarn test
git clone "`git remote get-url origin`" __deploy
cd __deploy
if [ "$CI" != "" ]; then
git config credential.helper "store --file=.git/credentials"
echo "https://benjie:${GITHUB_TOKEN}@github.com" > .git/credentials
fi;
git checkout master
cp -af ../public/* ./
echo 'www.graphile.org' > CNAME
git update-index -q --really-refresh
if ! git diff-index --exit-code --name-status HEAD --; then
git add .
git commit -m"Deploy $DATE"
git push origin master
else
echo "No changes to deploy"
fi