From 'Phillips Cycle Tours Round Edinburgh and the Scottish Borders' - Nick Cotton, page 48 - 53 but starting and finishing in LONGNIDDRY station (or North Berwick if preferred). It's 48km (30m), described as "Easy - rolling arable land with sea views, near to Edinburgh. Total height gain 230m (770ft)".
It is mainly on road, mostly quiet backroads, with the last 6km on an NCN old railway cyclepath, which is fine for road bikes - I road it last week.
Someone more capable than I can check it but
try this and see if it works.