A GitHub Action to sync a directory to another repository using SSH deploy keys.
- uses: fabraix/sync@v1.0.0
with:
source-directory: ./dist
destination-repository: your-org/target-repo
target-branch: master
user-email: bot@yourcompany.com
user-name: Sync Bot
env:
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 repository -
Add
sync_key(private key) as a Secret namedDEPLOY_KEYon the source repository
MIT