Potential theory for discrete and continuous semigroups