Skip to content

Instantly share code, notes, and snippets.

@netbe
Created June 8, 2012 14:39
Show Gist options
  • Save netbe/2895953 to your computer and use it in GitHub Desktop.
Save netbe/2895953 to your computer and use it in GitHub Desktop.
Script to deploy brunch build to gh-pages
#!/bin/bash
if [ $# -lt 4 ]
then
branch='gh-pages'
else
branch=$4
fi
if [ $# -lt 3 ]
then
temp_dir='./push_directory'
else
temp_dir=$3
fi
if [ $# -lt 2 ]
then
repo='triviasports-client'
else
repo=$2
fi
if [ $# -lt 1 ]
then
data_dir='brunch/build/web'
else
data_dir=$1
fi
# echo 'Build project'
# cd brunch
# brunch build -c config/web
# cd ..
echo 'Clone actual repo and push modifications'
if grep -q "$branch" $repo/.git/HEAD
then
echo 'Will pull data !'
cd $repo
git pull origin $branch
else
echo 'Need to create repo !'
git clone git@github.com:ChuguluGames/$repo.git --branch $branch
cd $repo
fi
cp -r ../$data_dir/* .
git add .
git commit -m 'Push version'
git push origin $branch
#
# echo 'Will clean temp file !'
# cd ..
# rm -rf $repo
#
# echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment