It just so happens that I've written a blog post on this very topic. The short answer is, in your terminal:
cat tmp/codeship_projectname.pub | ssh root@dokkuinstance.com "sudo sshcommand acl-add dokku codeship_projectname"
#!/bin/sh
git fetch --unshallow || true
git fetch origin "+refs/heads/*:refs/remotes/origin/*"
# checkout a remote branch with
# git checkout -b test origin/test
git remote add dokku dokku@dokkuinstance.com:projectname
git push dokku master
Here's the full tutorial onCONTINUOUS DEPLOYMENT WITH CODESHIP AND DOKKU