Js- syntax #49
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
name: Create Supabase Table | |
on: | |
push: | |
branches: | |
- test_table_script | |
jobs: | |
create-supabase-table: | |
runs-on: ubuntu-latest | |
env: | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | |
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }} | |
PROJECT_ID: oecrkeanazdxowjcpjqr | |
# SUPABASE_API_URL: https://$PROJECT_ID.supabase.co/rest/v1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
- name: Set up Supabase CLI | |
uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- name: Init | |
run: supabase init | |
- name: Configure Supabase | |
run: supabase link --project-ref $PROJECT_ID | |
- name: Create Supabase Table | |
run: | | |
TABLE_DEFINITION='[ | |
{ | |
"name": "reform_map_data", | |
"columns": [ | |
{ | |
"name": "id", | |
"type": "integer", | |
"primary": true | |
}, | |
{ | |
"name": "name", | |
"type": "text" | |
}, | |
{ | |
"name": "age", | |
"type": "integer" | |
} | |
# Add more columns as needed | |
] | |
} | |
]' | |
supabase api post /rest/v1/tables -d "$TABLE_DEFINITION" | |
# - name: Connect to PostgreSQL | |
# run: | | |
# psql -h 127.0.0.1 -U postgres -d postgres -p 5432 -c "SELECT version();" | |
# env: | |
# PGUSER: ${{ secrets.PG_USER }} | |
# PGPASSWORD: ${{ secrets.PG_PASSWORD }} | |
# - name: Supabase Migration | |
# run: supabase migration up | |