Skip to content

llxlr/fuck-deploy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuck Deploy

A GitHub Action to deploy projects to remote servers via rsync over SSH. Supports both private key and password authentication.

Inputs

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

Environment Variables

Variable Description
ENVIRONMENT Passed as a positional argument to the post-deploy script (e.g. prod, dev, staging)

Usage Examples

Key Authentication

- 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'

Password Authentication

- 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'

With Post-deploy Script

- 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.

How It Works

  1. If type is key: writes the private key to ~/.ssh/id_rsa.pem and sets proper permissions (700 / 600)
  2. Runs rsync with the configured arguments over SSH
  3. If script is 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.

Testing

Unit tests use mocked ssh/rsync/sshpass commands — no real server required.

bash test/test.sh

A unit-test job also runs automatically on push via the CI workflow.

References

About

Use rsync with SSH and SSHPASS to deploy project to server

Topics

Resources

License

Stars

7 stars

Watchers

0 watching

Forks

Contributors