Skip to content

Instantly share code, notes, and snippets.

@modster
Forked from vlucas/deploy.sh
Created May 30, 2022 00:17
Show Gist options
  • Save modster/1edd5ea76700d59515bedfce50ba4fb9 to your computer and use it in GitHub Desktop.
Save modster/1edd5ea76700d59515bedfce50ba4fb9 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