-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment Workflow
Here's a step-by-step SSH authentication guide for GitHub based on our setup.
Anyone using the same system user (e.g., root) will have access to the SSH key and GitHub authentication.
This guide explains how to set up SSH authentication for GitHub on a server.
Run the following command to check if an SSH key already exists:
ls -l ~/.ssh/id_*If you see files like id_ed25519 and id_ed25519.pub, an SSH key already exists. If not, generate a new one.
If no SSH key is found, create one with:
ssh-keygen -t ed25519 -C "your-email@example.com"- Press Enter to accept the default file location (
~/.ssh/id_ed25519). - Set a passphrase (optional).
Display the public key:
cat ~/.ssh/id_ed25519.pubCopy the output and add it to GitHub:
- Go to GitHub → Settings → SSH and GPG keys.
- Click New SSH key.
-
Title: Enter a name like
Server SSH Key. -
Key type: Select
Authentication Key. - Paste the copied public key.
- Click Add SSH key.
Verify the SSH key is working:
ssh -T git@github.comIf successful, you'll see:
Hi <your-username>! You've successfully authenticated, but GitHub does not provide shell access.
Check if the remote URL is set to HTTPS:
git remote -vIf you see a URL starting with https://, switch to SSH:
git remote set-url origin git@github.com:org-name/repo-name.gitVerify the update:
git remote -vYou should now see:
origingit@github.com:org-name/repo-name.git (fetch)
origingit@github.com:org-name/repo-name.git (push)
Now, fetch the latest updates from GitHub:
git pull origin main(Replace main with the actual branch name if different.)
git pull will work as well, as long as you're already on the correct branch and the remote (origin) is set up properly.
If the SSH key is under the user who owns the organization, it should have access to all repos the user has access to.
To confirm, try cloning a private repo from the org:
git clone git@github.com:org-name/repo-name.gitIf cloning succeeds, SSH authentication is fully set up.
This guide ensures anyone can log in with SSH, authenticate GitHub, and pull updates on this server.
- Log on server via *file transfer application (WinSCP [Windows]/Cyberduck [macOS]).
- Log in with superuser (root). [OPTIONAL]
- Navigate to project's
src -
git pull[origin main] (in case of conflict: rungit reset --hard HEADfirst) -
docker ps> CopyappID - Enter container with
docker exec -it {container_id} bash - Navigate to
frontend pnpm stop-
pnpm install && pnpm build(in case of conflict:pnpm store prune && rm -rf .next .turbo .tsbuildinfo node_modules pnpm-lock.yaml && pnpm install && pnpm build. pnpm start
-
Environment
-
Formatting
-
Frontend
-
Backend
-
DevOps
-
Resources