Would a deserter face a death sentence?

I know this would vary across centuries and cultures, but if a man were found deserting a battlefield, how would his superiors punish him?