Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # File: scripts/publish-gh-pages.sh
- # Get the full path to the script
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
- # Go to the project root
- cd "${DIR}"/..
- # Build the static files
- npm run build
- # Assuming the static files are located in ./dist
- cd dist/
- git init .
- # Commmit all static files
- git add .
- git commit -m 'gh-pages'
- # Publish to github as a singleton commit (--force)
- git remote add origin git@github.com:SnakeBytesTech/SnakeBytesTech.github.io.git
- git push origin master:gh-pages --force
- # WARNING: this will overwrite the gh-pages branch. Change it to whatever you want
Add Comment
Please, Sign In to add comment