Sha256: 6f398cfed02425c1437d6ad3595affb045ad9782c35766d04506c33c0faef555

Contents?: true

Size: 997 Bytes

Versions: 3

Compression:

Stored size: 997 Bytes

Contents

set -e

DEPLOY_REPO="https://${GITHUB_TOKEN}@github.com/hunterae/blocks.git"

function main {
	clean
	get_current_site
	build_site
	deploy
}

function clean {
	echo "cleaning _site folder"
	if [ -d "_site" ]; then rm -Rf _site; fi
}

function get_current_site {
	echo "getting latest site"
	git clone --depth 1 $DEPLOY_REPO _site
}

function build_site {
	echo "building site"
	bundle exec jekyll build
}

function deploy {
	echo "deploying changes"

	if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
	    echo "except don't publish site for pull requests"
	    exit 0
	fi

	if [ "$TRAVIS_BRANCH" != "master" ]; then
	    echo "except we should only publish the master branch. stopping here"
	    exit 0
	fi

	cd _site
	git config --global user.name "Travis CI"
    git config --global user.email 'Deployment Bot'
	git add -A
	git status
	git commit -m "Lastest site built on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to github"
	git push --force $DEPLOY_REPO master:gh-pages
}


main

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blocks-4.0.0 bin/deploy_docs
blocks-4.0.0.rc2 bin/deploy_docs
blocks-4.0.0.rc1 bin/deploy_docs