Merge branch 'main' into issue/74-agregar-trigger-para-cambios-en-asignatura
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
name: Supa-backup
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
run_db_backup:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
|
||||
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
|
||||
|
||||
# MinIO / S3 config
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
|
||||
S3_ENDPOINT: ${{ secrets.MINIO_ENDPOINT }}
|
||||
S3_BUCKET: ${{ secrets.MINIO_BUCKET }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
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: Create backup directory
|
||||
run: mkdir -p backup
|
||||
|
||||
#- name: Backup roles
|
||||
# run: supabase db dump -f backup/roles.sql --role-only
|
||||
|
||||
#- name: Backup schema
|
||||
# run: supabase db dump -f backup/schema.sql
|
||||
|
||||
- name: Backup data
|
||||
run: supabase db dump -f backup/data.sql --data-only
|
||||
|
||||
- name: Install AWS CLI
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
|
||||
- name: Upload to MinIO (S3)
|
||||
run: |
|
||||
TIMESTAMP=$(date +'%Y-%m-%d_%H-%M-%S')
|
||||
|
||||
aws --endpoint-url $S3_ENDPOINT s3 cp backup/ s3://$S3_BUCKET/SUPABASE/ --recursive
|
||||
@@ -42,10 +42,10 @@ jobs:
|
||||
if: steps.git_status.outputs.changed == 'true'
|
||||
run: |
|
||||
git config user.name "supabot"
|
||||
git config user.email "supabot@example.com"
|
||||
git config user.email "info.ingenieria@lasalle.mx"
|
||||
git add supabase/seed.sql
|
||||
git add supabase/functions/_shared/database.types.ts
|
||||
git commit -m "chore: update database seed & types"
|
||||
git commit -m "chore: update database seed & typescript types"
|
||||
|
||||
- name: Push changes
|
||||
if: steps.git_status.outputs.changed == 'true'
|
||||
|
||||
Reference in New Issue
Block a user