  Given a Kaehler manifold polarised by a holomorphic ample line bundle, we
consider the circle bundle associated to the polarisation with the induced
transversal holomorphic structure. The space of contact structures compatible
with this transversal structure is naturally identified with a bundle, of
infinite rank, over the space of Kaehler metrics in the first Chern class of
the polarisation. We show that the Einstein-Hilbert functional of the
associated Tanaka-Webster connections is a functional on this bundle, whose
critical points are constant scalar curvature Sasaki structures. In particular,
when the group of automorphisms is discrete, these critical points correspond
to constant scalar curvature Kaehler metrics in the first Chern class of the
polarisation. We show that the Einstein--Hilbert functional satisfies some
monotonicity properties along some one-parameter families of CR-contact
structures that are naturally associated to test configurations, and that its
limit on the central fibre of a test configuration is related to the
Donaldson-Futaki invariant through an expansion in terms of an extra real
parameter. As a by-product, we obtain an original proof that the existence of
constant scalar curvature Kaehler metrics on a polarized manifold implies
K-semistability. We also show that the limit of the Einstein-Hilbert functional
on the central fibre coincides with the ratio of the equivariant index
characters pole coefficients of the central fibre.
