When thinking about simple tasks that don't require much setup, a corn job immediately comes to mind. You can easily add 'npm run build' to crontab with your desired schedule, making it a hassle-free solution. For guidance on setting up cron jobs, check out this link with examples.
However, if you're looking to build your app and run database updates, utilizing a CI solution would be a more secure and efficient choice. Among the many options available, I recommend using Buddy, which offers a user-friendly interface and a free plan.
With Buddy, you can create pipelines that will execute tasks on your server via SSH or handle all actions within the Buddy CI environment before deploying compiled files to the server.
Furthermore, having a clear understanding of what 'npm run build' entails would enable us to provide a more specific and detailed response.