No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
butterrobot 255caf01d1 fix: entrypoint.sh is not executable, every run fails with exit 126 (#1)
entrypoint.sh is committed with mode 0644 while action.yml runs it directly as `${{ github.action_path }}/entrypoint.sh`, so the action fails before the script starts with 'entrypoint.sh: Permission denied' and exitcode 126 — the SSH key is never read, which makes it look like an auth failure. Sets the exec bit, and also invokes via 'sh' so the action no longer depends on the mode bit surviving a checkout. Found while deploying fmartingr/fmartingr.com (FMG-7).

Reviewed-on: #1
Reviewed-by: Felipe M <me@fmartingr.com>
2026-09-09 19:53:11 +02:00
.gitignore Initial release: SSH deploy action via rsync 2026-04-07 18:39:58 +02:00
action.yml fix: entrypoint.sh is not executable, every run fails with exit 126 (#1) 2026-09-09 19:53:11 +02:00
entrypoint.sh fix: entrypoint.sh is not executable, every run fails with exit 126 (#1) 2026-09-09 19:53:11 +02:00
LICENSE Initial release: SSH deploy action via rsync 2026-04-07 18:39:58 +02:00
README.md Initial release: SSH deploy action via rsync 2026-04-07 18:39:58 +02:00

SSH Deploy Action

A Forgejo/GitHub Action to deploy files to a remote server via SSH and rsync.

Inputs

Input Description Required Default
host SSH server address Yes
port SSH port No 22
username SSH login user Yes
key Private SSH key content Yes
source Local directory to deploy No .
target Remote path on the server Yes
args Extra rsync flags (e.g. --delete) No

Usage

steps:
  - uses: actions/checkout@v4

  - name: Build
    run: npm run build

  - name: Deploy
    uses: fmartingr/ssh-deploy-action@v1
    with:
      host: ${{ secrets.SSH_HOST }}
      username: ${{ secrets.SSH_USER }}
      key: ${{ secrets.SSH_PRIVATE_KEY }}
      source: dist/
      target: ${{ secrets.SSH_PATH }}

With extra rsync flags

  - name: Deploy
    uses: fmartingr/ssh-deploy-action@v1
    with:
      host: ${{ secrets.SSH_HOST }}
      username: ${{ secrets.SSH_USER }}
      key: ${{ secrets.SSH_PRIVATE_KEY }}
      source: dist/
      target: ${{ secrets.SSH_PATH }}
      args: --delete --exclude='.env'

SSH Key Setup

  1. Generate a dedicated deploy key:

    ssh-keygen -t ed25519 -C "deploy" -f deploy_key -N ""
    
  2. Add the public key to the server:

    cat deploy_key.pub >> ~/.ssh/authorized_keys
    
  3. Add the private key content as a secret (e.g. SSH_PRIVATE_KEY) in your Forgejo/GitHub repository settings.

License

MIT