Github, in it's infinite awesomeness, will host static sites for you for free! This means we can show off all of the work yall have done thus far.
Note that we can show off all the front-end stuff we've done, but this will not work for our php files. We could totally put some php scripts on our Github page, but they will not be evaluated.
For the most part, we will follow along with The Github Pages Tutorial.
The short version of all this is that github will host whatever content you have in a repository named username.github.io
at username.github.io
.
- While technically this is not neccessary, I would strongly advise you create a new site on your vagrant box to hold your site.
- from
~/vagrant-lamp
,ansible-playbook ansible/playbooks/vagrant/site/static.yml
- from
- Create a new repository on Github
- name it
username.github.io
whereusername
is your github username - It is very important that this repository is named correctly, otherwise this will not work!
- name it
- Initialize a git repository on your Mac
- Unlike our other projects, initialize this repository in the
public
folder, as this is where our static content lives.
- Unlike our other projects, initialize this repository in the
- Sync up and push the repository you created on your Mac to the one on Github
git remote add origin ...
git push -u origin master
- Visit your site!
- go to
username.github.io
to see the end product!
- go to
Whenever you make changes to your repository (e.g. modifying files, adding a new file) and push to master, those changes will automatically go live.
We must create our repository in the public
folder because whatever is in this repository (i.e. the public folder) will be hosted.
Like our vagrant box, Github's servers will automatically point to index.html
, so whatever is in this file is what will be displayed when you navigate to your site.