From 6e4265bdf8e6ac1340ba1f0330b95508bca29597 Mon Sep 17 00:00:00 2001 From: "Guillermo.Arrieta" Date: Tue, 17 Mar 2026 22:30:50 +0000 Subject: [PATCH] Actualizar .gitea/workflows/backup.yaml --- .gitea/workflows/backup.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/backup.yaml b/.gitea/workflows/backup.yaml index 39dbb6c..275845d 100644 --- a/.gitea/workflows/backup.yaml +++ b/.gitea/workflows/backup.yaml @@ -1,13 +1,12 @@ 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 @@ -17,21 +16,27 @@ jobs: SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_DESARROLLO_ACCESS_TOKEN }} SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_DESARROLLO_PROJECT_ID }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} + # Si es un PR, usa la rama origen. Si no, usa la rama que disparó el evento (main). + ref: ${{ github.head_ref || github.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 supabase/roles.sql --role-only + - name: Backup schema run: supabase db dump -f supabase/schema.sql + - name: Backup data run: supabase db dump -f supabase/data.sql --data-only --use-copy - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Supabase backup \ No newline at end of file