Remember do this to clone the repo in ubuntu server and execute all steps
Digital Ocean Example to install Docker.
sudo apt update && sudo apt upgrade -y
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
ssh-keygen -t rsa -b 4096 -C nodejs-app
- Settings > "SSH and GPG keys" > New SSH key
cat ~/.ssh/id_rsa.pub
- Key type: Authentication Key
- Add the public key to the authorized_keys file
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- Copy content of the private key file
cat ~/.ssh/id_rsa
- Settings > Secrets > Actions
SSH_PRIVATE_KEY: content of the private key file
SSH_USER: user to access the server
SSH_HOST: hostname/ip-address of your server
WORK_DIR: path to the directory containing the repository
MAIN_BRANCH: name of the main branch (mostly main)
With this you can access your server and execute any file or command from actions