Skip to content

Instantly share code, notes, and snippets.

@tooshel
Created December 30, 2024 17:12
Show Gist options
  • Save tooshel/d5ca02076101d15ee1aa166728e23111 to your computer and use it in GitHub Desktop.
Save tooshel/d5ca02076101d15ee1aa166728e23111 to your computer and use it in GitHub Desktop.
my favorite deploy script
# This stops the script on any error!
set -e
cd
mv Uplink*.zip old
rm -r build
myurl=`curl -s https://api.github.com/repos/<repo_name>/<repository>/releases/latest | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d \" `
echo $myurl
myfilename=`echo ${myurl##*/}`
echo $myfilename
wget -q $myurl
unzip $myfilename
echo "========="
echo "========="
echo "========="
if [ -d "/root/build" ]; then
echo "build folder exists, going to delete the old folder and deploy"
rm -r /var/www/html/*
# mkdir /var/www/html
cp -r ~/build/* /var/www/html
else
echo "build folder does not exist, deploy canceled"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment