Created
January 9, 2016 02:20
-
-
Save divyekapoor/42c8904dfd8a0267945b to your computer and use it in GitHub Desktop.
Static site on Github using a custom domain
This file contains hidden or 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 bash | |
# | |
# Author: Divye Kapoor (http://divye.in) | |
# | |
# This script sets up Github static pages for any repository. | |
# Just modify some of the lines below to specify your username and repository info | |
# and the script will do the rest. | |
# Modify these lines as per your requirements. | |
export GITHUB_USER=divyekapoor | |
export REPO_NAME=zigndog.com | |
export DOMAIN=zigndog.com | |
# Do not modify anything below. | |
git clone https://github.com/${GITHUB_USER}/${REPO_NAME}.git | |
cd ${REPO_NAME} | |
git checkout -b gh-pages | |
echo Welcome to ${DOMAIN} > index.html | |
echo ${DOMAIN} > CNAME | |
git commit -am 'Set up github pages.' | |
git push -u origin gh-pages | |
echo "Github pages set up. You are on the gh-pages branch." | |
echo "You may modify index.html to suit your needs." | |
echo "Publish new files to github with:" | |
echo ' $ git push origin gh-pages' | |
echo | |
echo "Check out: http://${GITHUB_USER}.github.io/${REPO_NAME} for the published files." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment