I channel some of my motivation into cultivating discipline. I also apply discipline to periodically remotivate myself.
In practice this means I'll do a hackathon to build something I want, while limiting myself to using one new technology that has to be relevant to my startup.
To stay motivated I pitch everyone I can because nothing motivates me as much as other people getting excited.
As someone that used to lack motivation and discipline, this has kept be going on my startup for 4+ years.