Skip to content

Instantly share code, notes, and snippets.

@ryanorsinger
Last active October 30, 2015 18:28
Show Gist options
  • Save ryanorsinger/b6f36cca63001b10ce33 to your computer and use it in GitHub Desktop.
Save ryanorsinger/b6f36cca63001b10ce33 to your computer and use it in GitHub Desktop.
github pages

Host your front-end files!

Step 1: Configure a new site.dev on your Vagrant box

  • From the ~/vagrant-lamp/ directory on your Mac
    • Run ansible-playbook ansible/playbooks/vagrant/site/static.yml
    • Name the site your-github-username.dev` with your GitHub user name.
    • Copy any .html files you want to host into ~/vagrant-lamp/sites/your-github-username.dev/public
    • Create folders for assets like css, js, img. Populate them as necessary.

Step 2: Setup your GitHub Pages repo

  • Create a new repository on GitHub
  • The repo must be named exactly as your GitHub username followed by .github.io
  • If your username is testUser then the repo should be named testUser.github.io
  • Follow the directions for adding a new project. They look like this:
    • Do git init from ~/vagrant-lamp/sites/<github-username.dev>/public folder on your Mac.
    • Use your own username here: git remote add origin [email protected]:<github-username>/<github-username>.github.io.git
    • git add <filename> or git add -A in order to add your desired files.
    • git commit -m "first commit"
    • git push -u origin master

Step 3:

  • Navigate to http://<yourUserName>.github.io and test it out!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment