Wrexham AFC, owned by Ryan Reynolds and Rob McElhenney, has earned promotion to the third division of English football.