Move asset logic from pre_build to deploy

This is identical to cf6040b.