I use something similar to sync modified files to an eclipse workspace. This is a stripped down version of the plugin i use. This would be executed after every save, even if the file you saved is not from the project! You could also make a build system. The authentication is not included in this sample.
[code]import sublime, sublime_plugin
def on_post_save(self, view):
# The shell script to deploy the project to the server
syncProject = """rsync --recursive --times --perms --exclude ".*" /path/to/project/ /path/to/server/"""
# execute the shell scripts