#!/bin/bash
cd "${WEBSITE_REPO_DIR}"
git add -A
if git diff --cached --quiet; then
echo "no changes have been detected since last build, nothing to publish"
else
echo "changes have been detected, publishing to Californium website repo on GitHub"
git config user.email "${PROJECT_NAME}-bot@eclipse.org"
git config user.name "${PROJECT_BOT_NAME}"
git commit -m "Website build ${JOB_NAME}-${BUILD_NUMBER}"
git push origin "HEAD:${WEBSITE_REPO_BRANCH_NAME}"
fi