Earthquake triggering by transient and static deformations