Running script after entry publish

Hello Everyone,

I have been checking docs and I’m confused with terms like middleware, lifecycle hooks etc.

Basically, I would like to run a static render script after an entry published.

Where is the best place to place to write this script? Possibly I will need to require and use some npm modules as well.