Skip to content

Instantly share code, notes, and snippets.

@LaisGalvao
Forked from vlucas/deploy.sh
Created July 26, 2022 16:10
Show Gist options
  • Save LaisGalvao/cbf736e10aba59c438e88e1b6dde5974 to your computer and use it in GitHub Desktop.
Save LaisGalvao/cbf736e10aba59c438e88e1b6dde5974 to your computer and use it in GitHub Desktop.
Deploy a Static Site to Github Pages
#!/bin/bash
GIT_REPO_URL=$(git config --get remote.origin.url)
mkdir .deploy
cp -R ./* .deploy
cd .deploy
git init .
git remote add github $GIT_REPO_URL
git checkout -b gh-pages
git add .
git commit -am "Static site deploy"
git push github gh-pages --force
cd ..
rm -rf .deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment