-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conf: added deploy githubaction to supabase. Added package.json scrip…
…t to init remote supabase. Moved db creation script to migration. Updated supabase conf to match remote one. Improved db creation migration to handle pre-existing web_anon role.
- Loading branch information
Julien MAIRE
authored and
Julien MAIRE
committed
Jan 31, 2025
1 parent
e8a7f1e
commit 4e1efd9
Showing
7 changed files
with
49 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Deploy to EC2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
#Deploy supabase | ||
- name: Run Docker Compose | ||
run: | | ||
npm run supabase:remote:init | ||
#Populate db | ||
- name: Populate DB | ||
env: | ||
SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }} | ||
run: | | ||
npx tsx tools/populateDbWithFakeData.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity | ||
WHERE pg_stat_activity.datname = current_database() AND pid <> pg_backend_pid(); | ||
DO $$ | ||
DECLARE | ||
r RECORD; | ||
BEGIN | ||
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public') | ||
LOOP | ||
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE'; | ||
END LOOP; | ||
END $$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters