bakerkretzmar / laravel-deploy-preview

A GitHub Action to deploy PR preview sites for Laravel apps.
MIT License
19 stars 6 forks source link

Support SQLite #29

Closed bakerkretzmar closed 10 months ago

bakerkretzmar commented 10 months ago

This PR adds support for using a SQLite database for preview sites instead of Forge-installed MySQL/MariaDB/Postgres.

Adding DB_CONNECTION=sqlite to the environment input will now make the action skip creating a database when creating a preview site, and configure the site to use the default SQLite connection details. The database file will be created automatically when migrations are run for the first time (during the first deployment).

I think this is a decent workaround for sites that don't need a database at all for now too. All Forge servers have SQLite installed so this will always work, but more importantly they all default to including artisan migrate --force in the deployment script, so completely bypassing all database setup is more complicated than just not creating one initially. If a preview site really doesn't need a database to exist at all, the easiest and fastest option is to set it up to use SQLite.

Closes #28.