New post Need visibility? Apply for a FREE post for your Startup.  Apply Here

How Tos

Step-by-step guide on How to Deploy a Webpage on GitHub Pages

4 Mins read

If you are a web developer or a coding enthusiast looking to showcase your web projects or create a personal website, GitHub Pages is an excellent option for hosting your webpages for free. GitHub Pages is a feature provided by GitHub, a popular code hosting and version control platform, that allows you to publish webpages directly from your GitHub repositories.

It should be noted that GitHub Pages is not the only platform that allows you to deploy you webpage for free – there are quite a number of other platforms.

Deploying a webpage on GitHub Pages is a simple and convenient way to showcase your web projects or create a personal website. By following the steps outlined in this guide, you can easily deploy your own webpage on GitHub Pages and customize it to suit your needs.

Step 1: Create a GitHub Repository
The first step in deploying a webpage on GitHub Pages is to create a GitHub repository. If you don’t have a GitHub account, you’ll need to sign up for one. Once you’re signed in, follow these steps:

1. Click on the “New” button in the top right corner of your GitHub account dashboard to create a new repository.

2. Give your repository a name. This name will be part of the URL of your webpage. For example, if you name your repository as “username.github.io”, where “username” is your GitHub username, your webpage URL will be “https://username.github.io”.

3. Make sure the repository is set to public, as GitHub Pages only works with public repositories.

4. Optionally, you can add a description, choose a license, and enable other settings as needed.

5. Click on the “Create repository” button to create your GitHub repository.

Step 2: Create and Upload Webpage Files
The next step is to create and upload your webpage files to the GitHub repository you just created. Here’s how you can do it:

1. On your local machine, create a new directory or folder that will contain your webpage files. This can be done using a code editor or a file explorer.

2. Add your HTML, CSS, JavaScript, and other necessary files to the directory. You can also create a new file called “index.html” that will be the main page of your webpage.

3. Make sure all the files are organized and linked correctly within your webpage files.

4. Navigate to the repository you created in Step 1 on GitHub, and click on the “Upload files” button, which is located near the right side of the repository page.

5. Drag and drop your webpage files from your local machine to the GitHub repository, or click on the “Choose your files” button to manually select and upload the files to the repository.

Step 3: Publish Your Webpage
After uploading your webpage files to the GitHub repository, the next step is to publish your webpage using GitHub Pages. Follow these steps:

1. Once the files are uploaded, scroll down to the “Commit changes” section, which is located below the file upload area.

2. Add a commit message describing your changes, and click on the “Commit changes” button to commit your files to the repository.

3. After the commit is completed, navigate to the main page of your repository on GitHub.

4. Click on the “Settings” tab, which is located on the right side of the repository page.

5. Scroll down to the “GitHub Pages” section, which is located near the bottom of the settings page.

6. Under the “Source” dropdown menu, select “main” (or “master” for older repositories) as the branch to publish your webpage from.

7. Click on the “Save” button to apply the changes.

GitHub Pages will now build and publish your webpage, and you will see a green success message with the URL of your published webpage. Your webpage is now live on GitHub Pages! You can access it using the URL provided in the success message, which will be in the format “https://username.github.io/repositoryname”, where “username” is your GitHub username and “repositoryname” is the name of the repository you created.

Step 4: Customize Your Webpage (Optional)
GitHub Pages provides several customization options to make your webpage look and feel the way you want it to.

Here are some optional steps to customize your webpage:

Choose a theme: GitHub Pages offers several built-in themes that you can apply to your webpage. You can select a theme from the “Theme Chooser” section in the GitHub Pages settings page. Once you select a theme, GitHub Pages will automatically apply the theme’s CSS and other assets to your webpage.

Customize CSS: If you want to further customize the appearance of your webpage, you can create and upload your own CSS file to the repository. You can then link to this CSS file from your HTML files to override the default theme CSS or add additional styling.

Add a custom domain: If you have your own domain name, you can configure GitHub Pages to use your custom domain. You can do this by adding a custom domain in the “Custom domain” section of the GitHub Pages settings page, and then updating your domain’s DNS settings to point to GitHub’s servers.

Step 5: Update and Maintain Your Webpage
Once your webpage is live on GitHub Pages, you can update and maintain it easily by pushing changes to the GitHub repository. Simply make changes to your local webpage files, commit and push the changes to the repository, and GitHub Pages will automatically rebuild and update your webpage.

You can also use the GitHub Pages settings page to customize other options, such as enabling or disabling HTTPS, enforcing HTTPS, or setting up a custom 404 error page.

Happy web development and enjoy your GitHub Pages hosted webpage!

Don’t miss any tech news ever!

We don’t spam! Read our privacy policy for more info.

795 posts

About author
When I'm not reading about tech, I'm writing about it, or thinking about the next weird food combinations to try. I do all these with my headphones plugged in, and a sticky note on my computer with the words: "The galaxy needs saving, Star Lord."
Articles
Related posts
How Tos

How to Recover/Reverse money sent to the wrong account in Nigeria

3 Mins read
In the era of Mobile App and USSD inter and intra bank transfer, transferring money to the wrong account is not outrightly…
How Tos

How to Quickly Block your ATM Card in case of Emergency: In App, Customer care line, SMS, USSD

3 Mins read
Misplacing your ATM card can be a stressful situation, especially in Nigeria. To protect your funds from unauthorized access, blocking your card…
How Tos

How to find, ping, and factory reset a lost or stolen Android device: A Comprehensive Guide

2 Mins read
Nothing beats the gross sadness that comes with losing a dear friend or loved one, but there’s something that subtly matches that…
Newsletter Subscription

🤞 Don’t miss any update!

We don’t spam! Read more in our privacy policy

Join our Telegram channel here - t.me/TechpadiAfrica

Leave a Reply

×
Now you knowRandom

Chiefy A Surgical Collaboration App Raises $4.2 Million In Seed Funding