Created
December 24, 2021 08:49
-
-
Save SamuelDavis/d0355b0f80afb685d9be421b4db5c110 to your computer and use it in GitHub Desktop.
Deploy Script for NPM projects with a `build` command which generate a `/dist` directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
NAME='repo' | |
# abort on errors | |
set -e | |
# build | |
npm run build | |
# navigate into the build output directory | |
cd dist | |
# if you are deploying to a custom domain | |
echo "${NAME}.sdavis.online" > CNAME | |
git init | |
git add -A | |
git commit -m 'deploy' | |
git push -f [email protected]:SamuelDavis/${NAME}.git master:gh-pages | |
cd - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment