Skip to content

6notes/push-to-another-repo-with-rsync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

push-to-another-repo-with-rsync

This is a fork of cpina's GitHub action that adds the rsync parameter. This lets the user specify what they want copied over and what files to ignore vs. copying the entire directory over and wiping the destination. "Rsync is a ... file copying tool".

Rsync

One can learn and test Rsync commands easier with RsyncOSX by Thomas Evensen. You can duplicate a similar directory structure as your source/destination repos, add some text files, then test your commands until it does what you want to do before adding the rsync command to the GitHub workflow file.

Example

  • The only real difference here in terms of the workflow file is the additional rsync parameter where you can supply an rsync command. The rsync parameter is optional (but also the only reason you would be using this action anyways).
name: DEPLOY

on:
  push:
    branches:
    - main

jobs:
  build:
    runs-on: ubuntu-latest
    container: ubuntu
    steps:
      - uses: actions/checkout@v3
      - name: Pushes to another repository
        id: push_directory
        uses: 6notes/push-to-another-repo-with-rsync@main
        env:
          SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
        with:
          source-directory: 'EXAMPLE/SRC/DIRECTORY'
          destination-github-username: 'USERNAME'
          destination-repository-name: 'REPO_NAME'
          user-email: [email protected]
          target-branch: main
          rsync: 'rsync --archive --verbose --delete --exclude=.git* --exclude=package*.json --exclude=node_modules --exclude=.next --exclude=README.md --stats'

Documentation for the unchanged parts of this GitHub Action

See the extensive documentation in https://cpina.github.io/push-to-another-repository-docs/ (includes examples, FAQ, troubleshooting, etc.).

GitHub repository of the documentation: https://github.com/cpina/push-to-another-repository-docs

About

GitHub Action to push to another repo and use rsync

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 97.6%
  • Dockerfile 2.4%