Open In App

How to Deploy Frontend Project on Github

Last Updated : 04 Aug, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Over 70% of web developers use GitHub Pages or GitHub repositories to showcase their portfolios, host static sites, or collaborate on front-end projects. It’s free, requires no server setup, and integrates directly with your codebase. In just a few simple steps, you can turn your local HTML/CSS and JS project into a publicly accessible website!

deploy_your_frontend_project_on_github_pages
Deployment

Git Installation and Set-Up

Git is an important part of GitHub. So first of all, we need to install Git and download the latest version of Git. Follow the step-by-step instructions for your operating system.

git-installation
git set-up


Step 1: Initilaize a Git Repository in a Frontend Project

Navigate to your frontend project folder in the terminal and initialize a local Git Repository

bash
git init


This command will create a .git folder where the details of the repository like remote and username and email are stored.

Step 2: Configure Git username and password

Set your identity for locally for this specific project.

bash
git config user.name "Your Name"
git config user.email "[email protected]"

To configure globally for your future repositories:

bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

This step ensures that every commit is linked to your identity.

Step 3: Create a New Repository on Github

  • Click the "+" icon on the top-right corner. Select "New repository".
newrepo
create repository


Fill in the repository name (e.g., MyProject), add an optional description, choose Public or Private, and click Create repository.

HowtocreateaRepositoryongithub
New Repository


Note: Once created, GitHub shows you a few lines of code — copy the one with https://github.com/dummyname/MyProject


Step 4: Now Add, Commit and push your Frontend Code

In your terminal(inside your project folder)

bash
git add .
git commit -m " added frontend file"
git remote add origin https://github.com/your-username/your-repo-name
git branch -M master
git push -u origin main

This will push your HTML, CSS, and JavaScript files to the GitHub repository.


gitpush
git push



Step 6 Now Setup Github Pages to Deploy your Site.

Now go to settings and select Pages


pages
pages



Now You will see Github Pages Select source , branch and then save all changes.

githubpages
Save Changes

Now After few seconds when you refresh you website it will be deployed .

Deployment
Deployment



Now ,click on that link and visit you site and you can see your project has been successfully deployed.

portfolio
portfolio



Article Tags :

Similar Reads