Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Last active February 21, 2020 10:18
Show Gist options
  • Save joseluisq/4a4b64d4e1b370e62dd029f9062f6634 to your computer and use it in GitHub Desktop.
Save joseluisq/4a4b64d4e1b370e62dd029f9062f6634 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