Created
August 27, 2018 03:23
-
-
Save thedavecarroll/74438e76f6d0de1a77d09bcd956d4203 to your computer and use it in GitHub Desktop.
CI Build Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e # halt script on error | |
echo | |
echo "------------------------------------------------------------------------------------------------------------------------" | |
if [ "$TRAVIS_PULL_REQUEST" != "false" -a "$TRAVIS_BRANCH" == "comments" ]; then | |
echo | |
echo "Building site for pull request for $TRAVIS_BRANCH..." | |
bundle exec jekyll build --config _config.yml --source . --destination ./docs | |
echo "Site built into /docs" | |
echo | |
echo "Proofing links" | |
bundle exec htmlproofer ./docs --disable-external --allow_hash_href | |
echo "Proofing links complete" | |
echo | |
echo "------------------------------------------------------------------------------------------------------------------------" | |
exit 0 | |
elif [ "$TRAVIS_BRANCH" == "master" ]; then | |
echo | |
echo "Building site for $TRAVIS_BRANCH..." | |
bundle exec jekyll build --config _config.yml --source . --destination ./docs | |
echo "Site built into /docs" | |
echo | |
echo "Proofing links" | |
bundle exec htmlproofer ./docs --disable-external --allow_hash_href | |
echo "Proofing links complete" | |
echo | |
echo "------------------------------------------------------------------------------------------------------------------------" | |
exit 0 | |
else | |
echo | |
echo "Build not triggered internally" | |
echo | |
echo "------------------------------------------------------------------------------------------------------------------------" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment