-
-
Save LaisGalvao/31786bcc33bd259e79a85ac4d0c1c70c to your computer and use it in GitHub Desktop.
Bash script to deploy a React app to Github pages
This file contains 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 | |
# abort on errors | |
set -e | |
# build | |
npm run build | |
# navigate into the build output directory | |
cd build | |
# if you are deploying to a custom domain | |
#echo 'myapp.com' > CNAME | |
# creating a git repo in the build folder | |
git init | |
git add -A | |
git commit -m 'deploy' | |
# if you are deploying to https://<USERNAME>.github.io | |
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master | |
# if you are deploying to https://<USERNAME>.github.io/<REPO> | |
git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages | |
cd - | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment