Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
Created November 14, 2020 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienbourdeau/5d6ee749fa3a32a453b472ee941db6c0 to your computer and use it in GitHub Desktop.
Save julienbourdeau/5d6ee749fa3a32a453b472ee941db6c0 to your computer and use it in GitHub Desktop.
Rebuild assets and deploy on Laravel Forge
#!/usr/local/bin/bash
# function e_header() { printf "\n${yellow}========== %s ==========${reset}\n" "$@" }
# function e_arrow() { printf "➜ $@\n" }
# TODO: Check if current branch is `master`
e_header "Rebuilding assets"
echo
e_arrow "Use correct node version (with nvm)"
. /usr/local/opt/nvm/nvm.sh
nvm use
echo
e_arrow "Build assets"
yarn prod
e_header "Commiting"
echo
e_arrow "Commit assets"
git add public
echo
git status
echo
git commit -m '🎨 Rebuild assets'
echo
git lg -4
echo
e_arrow "Push to Github"
git push
e_header "Deploy with Forge CLI"
echo
forge deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment