Deploying Drupal websites can be a hassle when you have multiple environments to maintain. Therefore it’s a good idea to automate your deployment process. Sit down, lay back, relax!
Meet Capistrano, a remote server automation and deployment tool written in Ruby. It can be used to deploy many kinds of applications to any number of machines (environments).
I gave a presentation about this topic on DrupalCamp Leuven 2015. I even covered this topic already a few years before on DrupalCamp Leuven 2013 about Capistrano v2, but since Capistrano v3 is completely rewritten from the ground up it became even easier to start using it for web applications which are not Ruby based as this dependency is left out in v3.
You can find the example code used for the presentation on the DrupalCap GitHub Project page.