Skip to content

Instantly share code, notes, and snippets.

@simonthor
Created April 27, 2020 10:07
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 simonthor/bc9ffa0e8584854c13ca8094bf78fbbe to your computer and use it in GitHub Desktop.
Save simonthor/bc9ffa0e8584854c13ca8094bf78fbbe to your computer and use it in GitHub Desktop.
Shell script used for building and deploying my personal website (github.com/simonthor/simonthor.github.io)
#!/usr/bin/env bash
# Compile into React app
cd dev
npm run build
# Copy compiled code to master branch of git but keep README
cd ..
mv ./build/README.md .
rm -r ./build/*
cp -rp ./dev/build/* ./build/
mv README.md ./build/
# push new version of compiled website to remote repo
cd build
git add .
git commit -m "$1"
git push
echo "Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment