From 82014cdbe2947cfc1e316703eff1743b1279376b Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Thu, 12 Mar 2026 14:15:43 +0000 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20.gitea/workflows/backup.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/backup.yaml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitea/workflows/backup.yaml diff --git a/.gitea/workflows/backup.yaml b/.gitea/workflows/backup.yaml new file mode 100644 index 0000000..a581d30 --- /dev/null +++ b/.gitea/workflows/backup.yaml @@ -0,0 +1,37 @@ +name: Supa-backup + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + schedule: + - cron: '0 0 * * *' # Runs every day at midnight +jobs: + run_db_backup: + runs-on: ubuntu-latest + permissions: + contents: write + env: + SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_DESARROLLO_ACCESS_TOKEN }} + SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_DESARROLLO_PROJECT_ID }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + - uses: supabase/setup-cli@v1 + with: + version: latest + - name: Link Project + run: supabase link --project-ref $SUPABASE_PROJECT_ID + - name: Backup roles + run: supabase db dump -f roles.sql --role-only + - name: Backup schema + run: supabase db dump -f schema.sql + - name: Backup data + run: supabase db dump -f data.sql --data-only --use-copy + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Supabase backup \ No newline at end of file