South Sudan's president and rebel chief Friday signed a ceasefire deal vowing to end nearly five months of civil war, under international pressure to stem bloodshed and avert famine and genocide.