Sha256: 5a877670bca75b0babd2cc65110cd9a6821b981951a1c83b9afacac448051676

Contents?: true

Size: 989 Bytes

Versions: 4

Compression:

Stored size: 989 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 [ -z "$TRAVIS_PULL_REQUEST" ]; 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

4 entries across 4 versions & 1 rubygems

Version Path
blocks-3.0.4 bin/deploy_docs
blocks-3.0.3 bin/deploy_docs
blocks-3.0.2 bin/deploy_docs
blocks-3.0.1 bin/deploy_docs