This is my handy dandy way to deploy lots of Supabase edge functions and sync my migrations all in one go:
In a makefile
at project root:
diff:
# see the migration protip below!
supabase db diff -f $(f) -s public,extensions --local
deploy:
@echo 'Deploying DB migrations now'
@supabase db push
@echo 'Deploying functions now'
@find ./supabase/functions/* -type d ! -name '_*' | xargs -I {} basename {} | xargs -I {} supabase functions deploy {}
.PHONY: diff deploy
Just run make deploy
and it will push the database migrations and deploy all edge functions in the supabase/functions
folder.
The edge functions deploy will also ignore all folders that start with _
, which is usually shared code modules and not an actual edge function that you would want to deploy.
Migration Generation ProTipโ
You can also use make diff f=my_migration_name
that I added in above to generate a database migration diff faster than you can say "Yes please!" (Actually the diff-ing is not very fast, so you might finish saying it before it completes. Try saying it letter by letter ๐)