You should use the parfile deployment functionality to do that. You create a par file (essentially a zip file) with the processdefinition.xml file containing the process definition in the root and add your action classes to a 'classes' folder in this par file. Then use ant or the api to deploy this par file to the database.
Alternatively, you can use the GPD that includes all classes mentioned in the processdefinition.xml file automatically during deployment.
Have a look at the 'build.processes' tag in the 'build.xml' file of jbpm for an example of doing it 'the ant way'.