Skip to content

Instantly share code, notes, and snippets.

@pauiglesias
Last active July 23, 2021 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauiglesias/9dd417817ffc628ab1921d80a393b8c6 to your computer and use it in GitHub Desktop.
Save pauiglesias/9dd417817ffc628ab1921d80a393b8c6 to your computer and use it in GitHub Desktop.
# No passphrase (!important), save as [name]_ed25519
ssh-keygen -t ed25519
# File ~/.ssh/config
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/[filename]
User [username]
# Add to known hosts
ssh -T git@deployment
# pm2 ecosystem.config.js
deploy : {
production : {
user : "[username",
host : ["ip"],
ref : "origin/[master|main]",
repo : "git@deployment:[group]/[repo].git",
path : "/var/www/[group]/[repo]/[repo-v1]",
"post-deploy" : "npm install"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment