The principle of least action in the space of Kähler potentials