Benjamin Netanyahu's government in Israel and what remains of Hamas in Gaza have reached a ceasefire deal that will take effect on Sunday.