-
Notifications
You must be signed in to change notification settings - Fork 43
/
deploy.sh
35 lines (27 loc) · 863 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
#!/usr/bin/env bash
# This bash file will deploy the build folder to the project gh-page
set -e
# Base directory for this entire project
BASEDIR=$(cd $(dirname $0) && pwd)
# Destination directory for built code
BUILDDIR="$BASEDIR/build"
# make folder and copy files
mkdir "$BUILDDIR"
cp "$BASEDIR/index.html" "$BUILDDIR"
cp "$BASEDIR/example.html" "$BUILDDIR"
cp "$BASEDIR/bower.json" "$BUILDDIR"
cp "$BASEDIR/.bowerrc" "$BUILDDIR"
cp -R "$BASEDIR/img" "$BUILDDIR"
cp -R "$BASEDIR/src" "$BUILDDIR"
# Create a new Git repo in build folder
cd "$BUILDDIR"
bower install
git init
# Set user details
git config user.name "iAyeBot"
git config user.email "[email protected]"
# First commit, .. horray!
git add .
git commit -m "Deploy to gh-pages"
# Force push ...
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1