본문 바로가기

Hosting with GitHub and Vercel

1. Create a GitHub Account

  • Go to GitHub and sign up for an account .

2. Create a New Repository

  • After logging in, click on the + icon at the top right and select New repository.
  • Name your repository (e.g., my-project).
  • Choose the Private option under visibility to keep the source code protected from others.
  • Optionally, add a description and a README file.
  • Click Create repository.

3. Create a Branch

  • After creating the repository, you will be on the main branch by default.
  • To create a new branch, click on the Branch: main dropdown.
  • Type a new name for your branch (e.g., feature-branch) and click Create branch.
  • Now you can work on this branch and make changes.

4. Set the Repository to Private (To Protect Your Source)

  • Go to your repository page.
  • Click on Settings (found under the repository name).
  • Scroll down to the Danger Zone section at the bottom.
  • You will see Change repository visibility. Click on Make private.
  • Confirm the action by typing the repository name and clicking I understand the consequences, make this repository private.

Now your repository is private, and only authorized users can view or clone the source code.

5. Push Your Code to GitHub (Optional)

If you’re working locally on your project and want to push it to GitHub:

  • Initialize a Git repository in your local project folder by running git init.
  • Add your files with git add ..
  • Commit your changes with git commit -m "Initial commit".
  • Push to GitHub using git push -u origin main.

 

1. Sign Up for Vercel

  • Go to Vercel and sign up using your GitHub account.
  • After receiving the verification email sent to the email connected with your GitHub.
  • go to the Vercel login page and click "Continue with GitHub".
  • Enter your desired Username.
  • Click Continue.

2. Link GitHub to Vercel

  • Once you're logged in to Vercel, you’ll be prompted to connect your GitHub account.
  • Click Authorize Vercel to grant Vercel access to your GitHub repositories.

3. Import Your Private GitHub Repository

  • After connecting GitHub, click on Import Project on the Vercel dashboard.
  • You will see a list of repositories. Select your private repository that you want to deploy.
  • If it’s not listed, you may need to select Only select repositories on GitHub and authorize Vercel for the specific repository.

4. Configure the Project

  • Select the framework you used (e.g., Other if you used just HTML, CSS, and JavaScript).
  • You don’t need to configure anything else if you’re using static files.

5. Deploy

  • Click Deploy to start the process. Vercel will automatically pull the code from your private GitHub repository and deploy it.
  • Once the deployment is done, Vercel will provide a live URL for your project.

6. Setting Up a Custom Domain (Optional)

  • If you want to use your own domain, go to the Domains section in Vercel.
  • Follow the steps to add and configure your custom domain (e.g., yourdomain.com).

7. Automatic Deployment

  • Vercel will automatically redeploy your project every time you push new changes to your private GitHub repository.