A GitHub Action to deploy projects to remote servers via rsync over SSH. Supports both private key and password authentication.
| Input | Required | Default | Description |
|---|---|---|---|
type |
Yes | — | Authentication method: key or password |
username |
Yes | — | Remote server username |
host |
Yes | — | Remote server IP or domain |
remote_path |
Yes | — | Target path on the remote server |
key |
if type=key |
— | SSH private key content |
password |
if type=password |
— | Remote server password |
port |
No | 22 |
SSH port |
local_path |
No | ./* |
Local path relative to GITHUB_WORKSPACE |
args |
No | -ratlz |
Extra rsync arguments |
ssh_args |
No | -o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no |
Extra SSH arguments |
include |
No | — | Files/directories to include (rsync --include) |
exclude |
No | — | Files/directories to exclude (rsync --exclude) |
script |
No | — | Post-deploy script path (relative to workspace), executed on the remote server |
| Variable | Description |
|---|---|
ENVIRONMENT |
Passed as a positional argument to the post-deploy script (e.g. prod, dev, staging) |
- uses: llxlr/fuck-deploy@master
with:
type: 'key'
key: ${{ secrets.SSH_PRIVATE_KEY }}
username: 'deploy'
host: 'example.com'
remote_path: '/var/www/app'
local_path: './dist'
exclude: |
'.env'
'node_modules'- uses: llxlr/fuck-deploy@master
with:
type: 'password'
password: ${{ secrets.SERVER_PASSWORD }}
username: 'root'
host: '192.168.1.100'
port: 2222
remote_path: '/opt/services/web'
args: '-avz --delete'- uses: llxlr/fuck-deploy@master
with:
type: 'key'
key: ${{ secrets.SSH_PRIVATE_KEY }}
username: 'deploy'
host: 'prod.example.com'
remote_path: '/srv/http'
script: 'scripts/deploy.sh'
env:
ENVIRONMENT: 'production'The post-deploy script is streamed to the remote server via bash -s and receives ENVIRONMENT as $1.
- If
typeiskey: writes the private key to~/.ssh/id_rsa.pemand sets proper permissions (700/600) - Runs
rsyncwith the configured arguments over SSH - If
scriptis provided, executes it on the remote server after sync completes
The action runs inside an Alpine Linux Docker container with openssh-client, sshpass, and rsync installed.
Unit tests use mocked ssh/rsync/sshpass commands — no real server required.
bash test/test.shA unit-test job also runs automatically on push via the CI workflow.