Cuba's president has vowed the Caribbean island state will defend itself if the US launches a military assault. US President Trump has repeatedly threatened to invade.