Skip to content
Merged

Test #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/DemoToMainMigration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Sync Migrations from Demo to Main

on:
pull_request:
branches:
- main # Se ejecuta cuando se crea un PR hacia la rama "main"
types:
- opened
- synchronize
- reopened

permissions:
contents: write # Permiso para escribir en el repo

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Obtener todo el historial para comparación

- name: Configure Git user
run: |
git config --global user.name "kravmaga95"
git config --global user.email "edwardsalex8034@gmail.com"

- name: Authenticate Git
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git

- name: Ensure demo branch is up-to-date
run: |
git fetch origin demo
git checkout demo || git checkout -b demo origin/demo
git pull --rebase origin demo || { echo "Error pulling demo branch"; exit 1; }

- name: Copy migration files from demo to temporary folder
run: |
# Verifica si la carpeta 'demo/migrations' existe y copia los archivos a una carpeta temporal fuera del repo
if [ -d "demo/migrations" ]; then
echo "Copying migration files from demo/migrations to temporary folder..."
mkdir -p /tmp/migrations # Carpeta temporal fuera del repositorio
cp demo/migrations/* /tmp/migrations/ # Copiar los archivos
else
echo "No migrations folder in demo, skipping copy."
exit 1
fi

- name: Checkout main branch
run: |
git fetch origin main
git checkout main || git checkout -b main origin/main
git pull --rebase origin main || { echo "Error pulling main branch"; exit 1; }

- name: Ensure prod/migrations folder exists in main
run: |
# Verifica si la carpeta prod/migrations existe en main, si no, la crea
if [ ! -d "prod/migrations" ]; then
mkdir -p prod/migrations # Crea la carpeta prod/migrations si no existe
echo "Created prod/migrations folder in main."
fi

- name: Copy migration files from temporary folder to prod/migrations
run: |
# Copia los archivos de la carpeta temporal a prod/migrations
echo "Copying migration files from temporary folder to prod/migrations..."
cp /tmp/migrations/* prod/migrations/

- name: Commit and push changes to main
run: |
git add prod/migrations/* # Agregar los archivos modificados
git commit -m "Sync migration files from demo to main"
git push origin main || { echo "Push failed"; exit 1; }
64 changes: 64 additions & 0 deletions .github/workflows/migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Sync Migrations from Test to Demo

on:
push:
branches:
- test # Se ejecuta cuando hay un push en la rama "test"

permissions:
contents: write # Permiso para escribir en el repo

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Obtener todo el historial para comparación

- name: Configure Git user
run: |
git config --global user.name "kravmaga95"
git config --global user.email "edwardsalex8034@gmail.com"
- name: Authenticate Git
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
- name: Ensure test branch is up-to-date
run: |
git checkout test
git pull --ff-only origin test || { echo "Error pulling test branch"; exit 1; }
- name: Copy migration files from test to temporary folder
run: |
# Verifica si la carpeta 'test/migrations' existe y copia los archivos a una carpeta temporal fuera del repo
if [ -d "test/migrations" ]; then
echo "Copying migration files from test/migrations to temporary folder..."
mkdir -p /tmp/migrations # Carpeta temporal fuera del repositorio
cp test/migrations/* /tmp/migrations/ # Copiar los archivos
else
echo "No migrations folder in test, skipping copy."
exit 1
fi
- name: Checkout demo branch
run: |
git fetch origin demo
git checkout demo || git checkout -b demo origin/demo
git pull --ff-only origin demo || { echo "Error pulling demo branch"; exit 1; }
- name: Ensure demo/migrations folder exists
run: |
# Verifica si la carpeta demo/migrations existe, si no, la crea
if [ ! -d "demo/migrations" ]; then
mkdir -p demo/migrations # Crea la carpeta demo/migrations si no existe
echo "Created migrations folder in demo."
fi
- name: Copy migration files from temporary folder to demo
run: |
# Copia los archivos de la carpeta temporal a demo/migrations
echo "Copying migration files from temporary folder to demo/migrations..."
cp /tmp/migrations/* demo/migrations/
- name: Commit and push changes to demo
run: |
git add demo/migrations/* # Agregar los archivos modificados
git commit -m "Sync migration files from test to demo"
git push origin demo || { echo "Push failed"; exit 1; }
6 changes: 0 additions & 6 deletions demo/.gitignore

This file was deleted.

153 changes: 0 additions & 153 deletions demo/Filter.scpf

This file was deleted.

Loading