-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaction.yaml
37 lines (35 loc) · 1.15 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: supa-backup
description: Generate a Supabase Database backup supabase-cli.
author: mansueli
inputs:
supabase_url:
description: 'The connection URL of your Supabase instance, formatted as postgresql://[userspec@][hostspec][/dbname][?paramspec]'
required: true
file_prefix:
description: 'The prefix of the backup files'
required: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Initialize Supabase CLI
run: supabase init
shell: bash
- name: Start Supabase CLI
run: supabase db start
shell: bash
- name: Backup roles
run: supabase db dump --db-url "${{ inputs.supabase_url }}" -f ${{ inputs.file_prefix }}roles.sql --role-only
shell: bash
- name: Backup schema
run: supabase db dump --db-url "${{ inputs.supabase_url }}" -f ${{ inputs.file_prefix }}schema.sql
shell: bash
- name: Backup data
run: supabase db dump --db-url "${{ inputs.supabase_url }}" -f ${{ inputs.file_prefix }}data.sql --data-only --use-copy
shell: bash
branding:
icon: database
color: green