When an instance container is started, Beach will automatically run a few actions - for example, doctrine:migrate will be called, in order to prepare the database schema for the new code which is going to get live. But you can also run your own scripts, simply by placing a specific file in the root directory of your project.
When you deploy an instance, a new container is started in the cluster. When it is running, all start up scripts will be run and once that is done, the container will tell the cluster management that it is ready for receiving traffic.
Simply create a file called beach-startup.sh, commit it to your project's root directory and deploy it. Here's an example which makes sure that Job Worker Queues are set up before the application goes live:
#!/bin/bash /application/flow queue:setup Stripe
Here's another example which flushes the content cache of a Neos 3.x or higher version on each deployment:
#!/bin/bash /application/flow flow:cache:flushone Neos_Fusion_Content