The pragmatic single-server pipeline
Not every project lives on a managed cloud platform. For VPS deployments, self-hosted servers, fleet management, or homelab work, SSH-based deploy is honest and reliable. The pattern:
- Store an SSH private key as a repo secret.
- In CI, write the key to a temp file with strict perms.
- Connect via
sshorrsync; run a deploy script.
Or use a packaged action: appleboy/ssh-action for command execution, burnett01/rsync-deployments for file sync.
SSH key hygiene
- Generate a new key just for CI — don't reuse your personal key.
- Restrict the authorized_keys entry on the target with
command="...",from="github-runner-ip-range", or both. - Rotate quarterly.
- Add the host to
~/.ssh/known_hostsin CI to prevent MITM.