Spain has deployed troops to its North African territory of Ceuta after officials warned the border had "totally collapsed" amid a surge in migrant crossings.