Application being able to self update with github

I’m creating a bot app with Node.JS and I’d like to make it able to update its dependecies automatically without needing to turn it off and do it manually, I want that the bot itself could programatically use the “npm update”.

But more important than that, I want that it could self update its own code if I make a “git push” on its repo. However, I don’t want to do it with every push, just chosen ones. After researching, I found GitHub Actions, but I’m still a little lost about it.

Thanks in advance.