Generate SSH key pair on your local device (not VPS):
ssh-keygen -t ed25519 -f deploy_key
This will generate:
deploy_key (private key, keep secret)deploy_key.pub (public key, share to server)# You should be logged in as deploy_user
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
nano ~/.ssh/authorized_keys
cat /home/server/.ssh/id_rsa.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILstbbZT76cJ0+ogky5UCgdzFx7XF/9bOxAyELYzKsyf zhiken@GAN-LAPTOP
Go to: GitHub Repo → Settings → Secrets and Variables → Actions