The largest unions representing San Francisco city workers have reached a deal with Mayor Daniel Lurie.