Israel and Lebanon have agreed to a ceasefire amid recent escalated attacks and a ground offensive.