Fork me on GitHub

Deploy WP

Description: auto deploy the generated Static WP site to Github

#!/bin/sh
if apt-cache policy unzip >/dev/null 2>&1; then
echo "Unzip is installed. Moving onto next step."
else
echo "Unzip wasn't detected. Installing Unzip... Please wait."
sudo apt-get --force-yes --yes install unzip
fi

#making dir and unzipping the content
mkdir wptmp
unzip wps.zip -d ~/wptmp

#making tmp directory for moving .git folder
mkdir gittmp
mv ~/wordpress/.git ~/gittmp
cp -a ~/wptmp/deploy-wp-static-github.sh ~/wordpress
mv ~/gittmp/.git ~/wordpress/
cd wordpress

#git commands
{
git add .
git commit -a -m "$1"
git push
}

#removing temp directory
rm -rf ~/wptmp
rm -rf ~/gittmp


Download the Script here.