Skip to content

Prepare GitHub Environment

For this lab, we will work with two application repositories: cloud-mastery-backend and cloud-mastery-frontend. First, we need to set up your GitHub account and configure it to work with your Google Cloud Shell environment.

Do you have a GitHub Account?

If you already have a GitHub account, you can skip directly to the next section: Setup Backend Repository


Step 1: Create or Login to an existing GitHub Account

  1. Navigate to the GitHub signup page: github.com/signup.

  2. Fill in your details (email, password, username) to create your account.

    GitHub Signup Page

  3. Complete the "Verify your account" puzzle to prove you're human.

    GitHub Account Verification Puzzle

  4. GitHub will send a verification code to your email address. Enter this code to confirm your email.

    Confirm Your Email Address

  5. Once verified, proceed to sign in. Your new GitHub account is now ready!

    New GitHub Account Dashboard


Step 2: Setup SSH Key from Cloud Shell

To securely clone the repository to your Cloud Shell, you need to add your Cloud Shell's SSH key to your GitHub account.

In the context of GitHub, public and private keys are used for secure authentication, primarily through SSH. The private key is kept secret on your local machine, while the corresponding public key is shared with GitHub. This allows GitHub to verify your identity when you perform actions like pushing to or pulling from a repository.

  1. Navigate back to your Google Cloud Shell tab.

  2. Run the ssh-keygen command to generate a new SSH key. Press Enter three times to accept the default file location and create a key without a passphrase.

    ssh-keygen
    
    Generate SSH Key in Cloud Shell

  3. Verify that the public key file (id_ed25519.pub) was created.

    ls -l .ssh/
    
    List SSH Key Files

  4. Display the public key and copy its entire content to your clipboard.

    cat .ssh/id_ed25519.pub
    
    Display and Copy Public Key

  5. Head back to your GitHub tab. Click on your profile icon in the top-right corner and select Settings.

    Navigate to GitHub Profile Select GitHub Settings

  6. In the left navigation menu, click on SSH and GPG keys.

    SSH and GPG Keys Menu

  7. Click New SSH key. Give it a descriptive Title (e.g., "Google Cloud Shell") and paste the copied key into the Key field. Click Add SSH key.

    Add New SSH Key to GitHub


Next Steps

Github setup is complete! You can now proceed to the next step, where we will fork and clone backend repo.