Gitea/GitHub action to transfer files using rsync
Go to file
h7x4 0cf142fc51
All checks were successful
Test upload web docs / test (push) Successful in 24s
.gitea/test: init
2024-12-10 21:02:57 +01:00
.gitea/workflows .gitea/test: init 2024-12-10 21:02:57 +01:00
action.yml Initial commit 2024-05-01 17:19:22 +02:00
LICENSE Initial commit 2024-05-01 17:19:22 +02:00
README.md README: fix url 2024-12-10 20:18:11 +01:00

Rsync action

This action sends the contents of a directory to a remote server using rsync.

Usage

Basic usage:

- name: Transfer files
  uses: https://git.pvv.ntnu.no/Projects/rsync-action@v1
  with:
    source: ./path/to/directory/
    target: /path/at/remote/
    username: username
    host: hostname
    ssh-key: ${{ secrets.SSH_KEY }}

Advanced usage:

- name: Transfer files
  uses: https://git.pvv.ntnu.no/Projects/rsync-action@v1
  with:
    source: ./path/to/directory/
    target: /path/at/remote/
    username: username
    host: hostname
    port: 2222
    ssh-key: ${{ secrets.SSH_KEY }}
    args: -avz --mkpath --exclude 'node_modules' --delete
    known-hosts: "[hostname]:2222 ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

To force the action to only write to a specific directory, and to prevent excessive damage should the SSH key be compromised, it is recommended to force the command in the authorized_keys file.

command="rrsync -wo /directory/to/write/to",restrict,no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

The path specified in target will now be relative to /directory/to/write/to.