I’m using a GitHub action to setup a staging environment from pull requests, which is working great. I’m starting to look into the teardown side of it when the pull request is closed and can’t figure out a good way to run a custom script before the app is destroyed.
In my staging toml config I run the setup script like so:
[deploy] release_command = "/app/bin/setup-staging"
I’d like to be able to do the opposite of this. Is there a way to either have a “teardown” command that runs when the app is destroyed or run a remote command on the server using flyctl that I can run before running
flyctl apps destroy?