{"id":17032934,"url":"https://github.com/up9cloud/action-rsync","last_synced_at":"2025-07-12T07:04:55.356Z","repository":{"id":65162157,"uuid":"278778193","full_name":"up9cloud/action-rsync","owner":"up9cloud","description":"Github action - rsync","archived":false,"fork":false,"pushed_at":"2025-03-25T06:28:04.000Z","size":46,"stargazers_count":36,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T12:16:13.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/up9cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-11T03:13:15.000Z","updated_at":"2025-05-20T03:19:02.000Z","dependencies_parsed_at":"2024-06-18T20:11:47.656Z","dependency_job_id":"09fc6e75-4991-425e-b71d-f09addf8b250","html_url":"https://github.com/up9cloud/action-rsync","commit_stats":{"total_commits":43,"total_committers":1,"mean_commits":43.0,"dds":0.0,"last_synced_commit":"0000c8e754e1e781b01a923533119d3b7fd3f283"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/up9cloud/action-rsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Faction-rsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Faction-rsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Faction-rsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Faction-rsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/up9cloud","download_url":"https://codeload.github.com/up9cloud/action-rsync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Faction-rsync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264952342,"owners_count":23688059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T08:31:02.297Z","updated_at":"2025-07-12T07:04:55.350Z","avatar_url":"https://github.com/up9cloud.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# action-rsync ![.github/workflows/main.yml](https://github.com/up9cloud/action-rsync/workflows/.github/workflows/main.yml/badge.svg) [![Docker Automated build](https://img.shields.io/docker/automated/sstc/action-rsync)](https://hub.docker.com/repository/docker/sstc/action-rsync)\n\n- Small: Alpine based image with pre-installed rsync, see [sstc/rsync](https://hub.docker.com/r/sstc/rsync).\n- Hooks: Basic pre and post scripts support.\n- Pure 😊: No github specific inputs, outputs, it can be used on other platform!\n\n## Quick start\n\n\u003e Github Action (`.github/workflows/*.yml`)\n\n```yml\non: [push]\njobs:\n  rsync:\n    runs-on: ubuntu-latest\n    steps:\n      # Must checkout first, otherwise it would show empty folder, see https://github.com/actions/checkout\n      - uses: actions/checkout@v4\n      # Modify `master` to a valid version, see https://github.com/marketplace/actions/action-rsync\n      - uses: up9cloud/action-rsync@master\n        env:\n          HOST: target.example.com\n          KEY: ${{secrets.DEPLOY_SSH_KEY}}\n          TARGET: /app/\n```\n\n\u003e Drone CI (`.drone.yml`)\n\n```yml\nkind: pipeline\ntype: docker\nname: default\n\nsteps:\n  - name: deploy\n    when:\n      branch:\n        - master\n      event: [push]\n    image: sstc/action-rsync\n    settings:\n      # lowercase attributes, see https://readme.drone.io/plugins/overview/#plugin-inputs\n      key:\n        from_secret: deploy_ssh_key\n      host: target.example.com\n      target: /app/\n```\n\n\u003e Docker Container\n\n```bash\ndocker run -it --rm \\\n  -v $(pwd):/app \\\n  -w /app \\\n  -e HOST=\"target.example.com\" \\\n  -e KEY=\"$(cat ~/.ssh/id_rsa)\"\n  -e TARGET=\"/app/\" \\\n  sstc/action-rsync\n```\n\n## ENVs\n\n||Default Value|Description|\n|---|---|---|\n|**`HOST`**||Remote server ssh hostname or ip address\u003cbr\u003e**Required if** **`MODE`** is `push` or `pull`|\n|**`REMOTE_HOSTS`**||Multiple remote hosts\u003cbr\u003eCould be comma separate items style, e.q. 1.2.3.4,8.8.4.4\u003cbr\u003eor one line one item style, e.q. 8.8.8.8\\n111.111.111.111\u003cbr\u003eIt will execute pre \u0026 post scripts on every host\u003cbr\u003e**Required if** **`MODE`** is `push` or `pull`|\n|**`USER`**|`root`|Remote server ssh user\u003cbr\u003eIt's useless when **`MODE`** is `local`|\n|**`PORT`**|`22`|Remote server ssh port\u003cbr\u003eIt's useless when **`MODE`** is `local`|\n|**`KEY`**||The ssh private key\u003cbr\u003e**Required if** **`PASSWORD`** is not provided and **`MODE`** is `push` or `pull`|\n|**`PASSWORD`**||The ssh password\u003cbr\u003e**Required if** **`KEY`** is not provided and **`MODE`** is `push` or `pull`|\n|**`SOURCE`**|`./`|Source path for folder or file|\n|**`TARGET`**||Target path for folder or file\u003cbr\u003e**Required**|\n|**`MODE`**|`push`|Must be one of:\u003cbr\u003e`push`: local (SOURCE) to remote (TARGET)\u003cbr\u003e`pull`: remote (SOURCE) to local (TARGET)\u003cbr\u003e`local`: local (SOURCE) to local (TARGET)|\n|**`VERBOSE`**|`false`|Set it to `true` when you need some tips|\n|**`ARGS`**|`-avz --delete --exclude=/.git/ --exclude=/.github/`|Arguments for rsync|\n|**`ARGS_MORE`**||More rsync arguments. Append more args for rsync, it means the final rsync arguments will be: `$ARGS $ARGS_MORE`.\u003cbr\u003e\u003cbr\u003eFor example, if you set ARGS_MORE to be `--no-o --no-g` and keep ARGS as default, then the final args will be: `-avz --delete --exclude=/.git/ --exclude=/.github/ --no-o --no-g`|\n|**`SSH_ARGS`**|`-p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet`|Arguments for ssh. The value of `-p` is dynamic, depends on what value you set for `PORT`, but what if you set SSH_ARGS, the PORT would be ignored|\n|**`RUN_SCRIPT_ON`**|`target`|Must be one of:\u003cbr\u003e`target`: When **`MODE`** is `push`, run pre and post scripts on remote (because the target is on remote). When **`MODE`** is others, run on local.\u003cbr\u003e`source`: When **`MODE`** is `push`, run pre and post scripts on local. When **`MODE`** is others, run on remote.\u003cbr\u003e`local`: Always run scripts on local.\u003cbr\u003e`remote`: Always run scripts on remote.|\n|**`PRE_SCRIPT`**||The script runs before rsync.\u003cbr\u003eThe target system of RUN_SCRIPT_ON must support `mktemp` command|\n|**`POST_SCRIPT`**||The script runs after rsync.\u003cbr\u003eThe target system of RUN_SCRIPT_ON must support `mktemp` command|\n\n### Example\n\n```yml\non: [push]\njobs:\n  rsync:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - name: Deploy to my ❤️\n      uses: up9cloud/action-rsync@master\n      env:\n        HOST: example.com\n        KEY: ${{secrets.DEPLOY_SSH_KEY}}\n        # PASSWORD: ${{secrets.DEPLOY_SSH_PASSWORD}} # it's less secure, using KEY instead\n        TARGET: /app/hello-service/\n\n        VERBOSE: true\n        USER: ubuntu\n        # PORT: 2222 # no need to set this, because of $SSH_ARGS\n        ARGS: -az --exclude=/.git/\n        SSH_ARGS: '-p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'\n        SOURCE: ./public/\n\n        PRE_SCRIPT: |\n          echo start at:\n          date -u\n        POST_SCRIPT: \"echo done at: \u0026\u0026 date -u\"\n```\n\nSee also: [.github/workflows/main.yml](https://github.com/up9cloud/action-rsync/blob/master/.github/workflows/main.yml)\n\n## TODO\n\n- [ ] test ssh connection before executing\n- [ ] benchmark, compare with other actions based on js\n- [ ] lock the version of docker image\n- [ ] let variable names more meaningful, e.q. HOST to REMOTE_HOST\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup9cloud%2Faction-rsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fup9cloud%2Faction-rsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup9cloud%2Faction-rsync/lists"}