Skip to content

Instantly share code, notes, and snippets.

@rjbultitude
Created November 19, 2019 12:22
Show Gist options
  • Save rjbultitude/879d044fb359a7ad8c945c2b2bc7d624 to your computer and use it in GitHub Desktop.
Save rjbultitude/879d044fb359a7ad8c945c2b2bc7d624 to your computer and use it in GitHub Desktop.
Feature environments deploy script
#/bin/bash
npm run build
# get the current branch name and create a directory destination using it
dest_dir="project-dir/$(git rev-parse --abbrev-ref HEAD)"
# make the destination directory
mkdir -p $dest_dir
# copy the web build
cp -R public/build/ $dest_dir
# commit and push changes
cd project-dir
git add .
git commit -m "new deployment at ${date}"
git pull
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment