I have a Raspberry Pi running a Python script posting data to a database on my server. So I would like to do the inverse of this. I need this raspberry pi to do some actions when they are called from the website.
What would be the best approach?
Maybe open some port and start listening for events there?
There are two simple ways to achieve this. You haven't described what sort of actions you are processing so the following is quite generic.

Polling

Have a master that all of the workers (pi) connect to and poll to get any work. The workers can do the work and send data back to the master.

Event driven

Run an API on each pi that your master can call for each event. This is going to be the most performant but will probably require more work.
Communicate to a local device from website