<abstract><p>We derive the equations of motion of an action-dependent version of the Einstein-Hilbert Lagrangian as a specific instance of the Herglotz variational problem. Action-dependent Lagrangians lead to dissipative dynamics, which cannot be obtained with the standard method of Lagrangian field theory. First-order theories of this kind are relatively well understood, but examples of singular or higher-order action-dependent field theories are scarce. This work constitutes an example of such a theory. By casting the problem in clear geometric terms, we are able to obtain a Lorentz invariant set of equations, which contrasts with previous attempts.</p></abstract>