Most people use CI (Continuous Integration) tools like https://travis-ci.org/ (Its free for public repos and I ain't advocating it) to do the building of gem, and scripts to make the gem push happen.
Refer to (the documentation talks about paid version of things. Not sure if its available in free for public repos):