Skip to content

Instantly share code, notes, and snippets.

@giasraya
Forked from joseluisq/github_deploy.sh
Created February 21, 2020 10:18
Show Gist options
  • Save giasraya/a010134598d5bcdf4b3e00b1f56ad59f to your computer and use it in GitHub Desktop.
Save giasraya/a010134598d5bcdf4b3e00b1f56ad59f to your computer and use it in GitHub Desktop.
Tiny Github local deployment bash script
#!/bin/sh
# Tiny Github deployment bash script
# @author José Luis Quintana <quintana.io>
# @datetime 2016-10-22
# Settings
REPO_PATH=username/repo-name
DEPLOY_PATH=/deploy/path/on/my/server
# Deployment process
find ${DEPLOY_PATH}/ -mindepth 1 -delete
git clone https://github.com/${REPO_PATH}.git --depth=1 ${DEPLOY_PATH}
rm -fr ${DEPLOY_PATH}/.git
# Working directory
cd ${DEPLOY_PATH}
# Custom commands (replace)
npm i
npm run build
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment