DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. Join them; it only takes a minute:

Thanks to this blog post for the following script. Then, make a file called start.sh in the top level of your repository (if you use a different name, change the circle.yml's last line) that contains the following:

Finally, to allow the script to work you'll need to set the script to be executable with chmod and add the environment variables and your DEPLOY_USER's ssh key (preferably) or credentials (if no ssh key) to CircleCI. After doing that CircleCI should deploy your app after a successful build.