A GitHub Action to sync a directory to another repository using SSH deploy keys.
- uses: fabraix/sync@v1.0.0with:
source-directory: ./distdestination-repository: your-org/target-repotarget-branch: masteruser-email: bot@yourcompany.comuser-name: Sync Botenv:
SSH_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}| Input | Required | Default | Description |
|---|---|---|---|
source-directory | ✅ | - | Source directory to sync |
destination-repository | ✅ | - | Destination repository (e.g., org/repo) |
target-branch | ❌ | master | Target branch in destination |
target-directory | ❌ | '' | Target directory (empty for root) |
commit-message | ❌ | Sync from ORIGIN_COMMIT | Commit message |
user-email | ✅ | - | Git user email |
user-name | ✅ | - | Git user name |
| Secret | Required | Description |
|---|---|---|
SSH_DEPLOY_KEY | ✅ | SSH private key with write access to destination repo |
Generate an SSH key pair:
ssh-keygen -t ed25519 -C "sync-bot" -f sync_key -N ""
Add
sync_key.pubas a Deploy Key (with write access) on the destination repositoryAdd
sync_key(private key) as a Secret namedDEPLOY_KEYon the source repository
MIT