GitHub action to push directory to another GitHub repository
You need to provide the target repository's private key as a secret.
- Create an SSH key-pair on your machine
- Add the public key to your target repository as a deploy key with write access
- Add the private key to your source repository as a secret (for example
MY_GITHUB_PRIVATE_SSH_KEY
)
uses: markjivko/push-to-github@main
env:
GITHUB_SSH_KEY: ${{ secrets.MY_GITHUB_PRIVATE_SSH_KEY }}
with:
source-directory: "out"
target-github-username: "my-user"
target-github-repository: "my-repo"
target-github-branch: "main"
commit-email: "[email protected]"
commit-name: "John Doe"
commit-message: ${{ github.event.head_commit.message }}