Files
sigpro/.github/workflows/sync-to-github.yml
natxocc ccdbeb1b16
Some checks failed
Sync selected files to GitHub / sync (push) Failing after 1s
Actualizar .github/workflows/sync-to-github.yml
2026-04-26 18:30:50 +02:00

43 lines
1.3 KiB
YAML

name: Sync selected files to GitHub
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Clone source from local bare repo
run: |
git clone --local /repo.git source
cd source
git checkout main
ls -la
- 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 "Sync Bot"
git config user.email "bot@natxocc.com"
- name: Copy selected files
run: |
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"
fi
done
- name: Commit and push to GitHub
run: |
cd dest
git add .
git diff --staged --quiet || (git commit -m "Sync selected files from Gitea [skip ci]" && git push origin main)