From c28b1860e7f85a4698b98b8734de7bb0a86cf351 Mon Sep 17 00:00:00 2001 From: natxocc Date: Sun, 26 Apr 2026 17:52:22 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20.github/workflows/sync-to-github.?= =?UTF-8?q?yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-to-github.yml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/sync-to-github.yml diff --git a/.github/workflows/sync-to-github.yml b/.github/workflows/sync-to-github.yml new file mode 100644 index 0000000..92d6799 --- /dev/null +++ b/.github/workflows/sync-to-github.yml @@ -0,0 +1,55 @@ +name: Sync selected files to GitHub + +on: + push: + branches: [ main, master ] + workflow_dispatch: # permite ejecución manual + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout source (Gitea) + uses: actions/checkout@v4 + with: + path: source + + - name: Clone destination (GitHub) + run: | + git clone https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/natxocc/sigpro.git dest + cd dest + git config user.name "Gitea Sync Bot" + git config user.email "bot@natxocc.com" + + - name: Copy selected files + run: | + # Lista de archivos (rutas relativas desde la raíz del repositorio) + FILES=" + sigpro.js + sigpro.d.ts + vite/index.js + dist/sigpro.esm.js + dist/sigpro.esm.min.js + dist/sigpro.js + dist/sigpro.min.js + " + for file in $FILES; do + if [ -f "source/$file" ]; then + mkdir -p "dest/$(dirname $file)" + cp "source/$file" "dest/$file" + echo "Copied $file" + else + echo "Warning: source/$file not found, skipping" + fi + done + + - name: Commit and push changes + run: | + cd dest + git add . + if git diff --staged --quiet; then + echo "No changes to sync" + else + git commit -m "Sync selected files from Gitea [skip ci]" + git push origin main + fi \ No newline at end of file