I am moving one of my clients from using php forge + a colo server to github actions + fly.
I have set up a github workflow to do deploys on PR merges, per the docs. It works fine. What I can’t figure out how to do (which forge does) is run db migrations on deploy.
I was hoping I could add to the Dockerfile that fly creates for laravel:
RUN composer install --optimize-autoloader --no-dev \ && mkdir -p storage/logs \ && php artisan optimize:clear \ && php artisan migrate --force \ # <-- this
…however, it appears that the environment hasn’t been injected which this runs, so it’s not actually able to access the db cluster.
Is there a better pattern for this?