DevOps
How to Securely Deploy Your App to a Server Using GitHub Actions
Aashish Timalsina
March 19, 2026
8 min read1,240 views
Automate server deployment with GitHub Actions using SSH key-based auth and secure repository secrets.
# How to Securely Deploy Your App to a Server Using GitHub Actions
Manual SSH deployments are easy to break and hard to scale. This guide explains how to automate deployments with GitHub Actions using secure secrets.
## Required Secrets
Set five repository secrets: SERVER_HOST, SERVER_USER, SERVER_PORT, SERVER_SSH_KEY, and SERVER_RESTART_COMMAND.
## Generate Dedicated SSH Key
Create an ED25519 key pair specifically for deployment automation. Add the public key to authorized_keys on the server and store the private key in GitHub Actions secrets.
## Restart Command Options
Use a restart command based on your runtime stack, such as systemd, supervisor, or nginx reload only for static apps.
## Deployment Checklist
Use a repeatable checklist so every environment can be configured safely and consistently.
Aashish Timalsina
Full-stack developer focused on Laravel, Django, Docker, and practical server deployment workflows.
View Profile2,340 followers
Related Articles
DevOps
Deploying a Laravel Application on DigitalOcean Using Docker (Step-by-Step Guide)
A practical, from-zero deployment walkthrough for Laravel on a DigitalOcean droplet using Docker, Nginx, PHP-FPM, and MySQL.
Aashish Timalsina
Dec 26, 2025
1,86012293m read
DevOps
Setting Up Multiple Laravel Projects on Nginx in Linux
A practical guide to host multiple Laravel apps with Nginx, including cleanup, site templates, and service setup.
Aashish Timalsina
Jan 11, 2025
1,3209463m read
Table of Contents
Article Stats
Views1,240
Likes98
Comments11
Reading Time8 min