Update sync-to-private.yml #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync to Private Repo | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout del repo público | |
| uses: actions/checkout@v3 | |
| - name: Sincronizar con privado sin borrar nada | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "[email protected]" | |
| # Clona el repo privado con .git incluido | |
| git clone https://x-access-token:${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/BorisFaj/remedios.git private-repo | |
| # Copia archivos del repo público al repo privado | |
| rsync -av --progress ./ private-repo/ \ | |
| --exclude=".git/" \ | |
| --exclude=".github/" \ | |
| --exclude=".gitignore" \ | |
| --exclude="remedios/log/" \ | |
| --exclude="test/" \ | |
| --exclude="README.md" \ | |
| --exclude="diagrama.webp" | |
| cd private-repo | |
| git add . | |
| git commit -m "Sync desde repo público 🚀" || echo "Sin cambios" | |
| git push origin HEAD:public-sync | |