Skip to content

Instantly share code, notes, and snippets.

View devzakir's full-sized avatar
🏠
Building @JuggleHire for busy recruiters

Zakir Hossen devzakir

🏠
Building @JuggleHire for busy recruiters
View GitHub Profile
@devzakir
devzakir / docs.md
Last active January 27, 2022 07:02
Managing multiple GitHub Deploy Keys on a single server

GitHub allows you to attach a deploy key to any of your repositories. However, each repo must have its own unique key. If you’re deploying multiple GitHub repos on a single machine, that means you’ll need to set up multiple ssh keys for that machine. The easiest way to achieve this is to leverage ssh’s host config. If you have mygithubuser/repo1 and mygithubuser/repo2 that you want to deploy on a single machine, first create an rsa key pair for each repo:

ssh-keygen -t rsa -f ~/.ssh/repo1_rsa -C "repo1 deploy"
ssh-keygen -t rsa -f ~/.ssh/repo2_rsa -C "repo2 deploy"

Cat the public keys and copy+paste them into each repo’s respective GitHub deploy key:

@blvz
blvz / gh-deploy-clone.sh
Last active June 3, 2025 05:00
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@cobyism
cobyism / gh-pages-deploy.md
Last active September 29, 2025 14:15
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).