Israel's prime minister, Benjamin Netanyahu, and his security cabinet have approved a ceasefire deal.