Why
When testing a deployment for a frontend and pushing new code, the deployment was stuck in an infinite loop of detecting that the code changed and rebuilt, deployed.
What
Investigate what can cause and implement the fix. Refactor the code if needed.