bash/deploy.sh in jgd-1.3.1 vs bash/deploy.sh in jgd-1.4
- old
+ new
@@ -8,12 +8,20 @@
CLONE=${TEMP}/clone
echo -e "Cloning Github repository:"
git clone "${URL}" "${CLONE}"
-echo -e "\nBuilding Jekyll site:"
+echo -e "\nRegistering variables:"
cd "${CLONE}"
+USER_EMAIL=$(git config --get user.email)
+USER_EMAIL=${USER_EMAIL:-"jgd@teamed.io"}
+USER_NAME=$(git config --get user.name)
+USER_NAME=${USER_NAME:-"jekyll-github-deploy"}
+
+VERSION=$(git describe --always --tag)
+
+echo -e "\nBuilding Jekyll site:"
rm -rf _site
jekyll build
cp -R _site ${TEMP}
echo -e "\nPreparing gh-pages branch:"
@@ -24,14 +32,14 @@
fi
echo -e "\nDeploying into gh-pages branch:"
rm -rf *
cp -R ${TEMP}/_site/* .
-rm README.md
+rm -f README.md
git add .
-git config user.email "jgd@teamed.io"
-git config user.name "jekyll-github-deploy"
-git commit -am "new site version deployed" --allow-empty
+git config user.email "${USER_EMAIL}"
+git config user.name "${USER_NAME}"
+git commit -am "new site version ${VERSION} deployed" --allow-empty
git push origin gh-pages 2>&1 | sed 's|'$URL'|[skipped]|g'
echo -e "\nCleaning up:"
rm -rf "${CLONE}"
rm -rf "${SITE}"