Step 2: a deploy key for the pipeline
On your laptop, a new key pair, only for the pipeline, no passphrase:
ssh-keygen -t ed25519 -C "gitlab-ci-deploy" -f ~/.ssh/iti0302-deploy -N ""
Public half to the server. On your laptop, print it and copy the whole line:
cat ~/.ssh/iti0302-deploy.pub
On the server, paste it as a new line at the end of the file that lists allowed keys, and save. Same on macOS, Linux and Windows:
nano ~/.ssh/authorized_keys
Check: logging in with the new key works and needs no password:
ssh -i ~/.ssh/iti0302-deploy ubuntu@<ip> hostname