Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Created July 18, 2012 22:01
Show Gist options
  • Save frsyuki/3139198 to your computer and use it in GitHub Desktop.
Save frsyuki/3139198 to your computer and use it in GitHub Desktop.

Publishing website at <lang>.msgpack.org domain

Please read this article if you didn't yet: Updates on the MessagePack Project

1. Creating clean "gh-pages" branch

# Use your project name here
PROJ=ruby

# Clone the repository to ./msgpack-<lang>-doc directory
git clone git@github.com:msgpack/msgpack-$PROJ.git msgpack-$PROJ-doc
cd msgpack-$PROJ-doc

# Create gh-pages branch
git symbolic-ref HEAD refs/heads/gh-pages
rm -f .git/index
git clean -fdx

2. Adding "CNAME" file to the branch

# Write "<lang>.msgpack.org" line to "CNAME" file
echo $PROJ.msgpack.org > CNAME
git add CNAME
git commit -a -m "GitHub Pages for $PROJ.msgpack.org"

# Push the branch to github
git push -u origin gh-pages

3. That's all!

Wait several minutes until github finishes to generate the website. Then access to http://<lang>.msgpack.org/.

You can use git clone -b gh-pages to clone the branch from other computers as following:

git clone git@github.com:msgpack/msgpack-$PROJ.git msgpack-$PROJ-doc -b gh-pages

See http://ruby.msgpack.org and https://github.com/msgpack/msgpack-ruby/tree/gh-pages for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment