Skip to content

Instantly share code, notes, and snippets.

@kas-cor
Created May 10, 2023 15:23
Show Gist options
  • Save kas-cor/0f406e14bad743545403cb0f4e3b97ea to your computer and use it in GitHub Desktop.
Save kas-cor/0f406e14bad743545403cb0f4e3b97ea to your computer and use it in GitHub Desktop.
Self PHP Deploy
#!/bin/sh
# Developer deploy, if change in dev branch then run deploy_dev.sh
cd /path/to/site && git fetch
if [[ $(git log --oneline -n1 dev..origin/dev) ]]; then
echo Delpoy dev...
./deploy_dev.sh
fi
# Prodaction deploy, if change in master branch then run deploy_prod.sh
cd /path/to/site && git fetch
if [[ $(git log --oneline -n1 master..origin/master) ]]; then
echo Delpoy prod...
./deploy_prod.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment