How to Setup and Create GitHub Pages (Serverless Static Apps)


Creating a GitHub Pages site is a simple process that allows you to host a personal, project, or organisation site for free. Follow this guide to get started.

Step 1: Create a GitHub Repository

  • Log in to your GitHub account.
  • Click on “New” to create a repository.
  • For a personal site, name it <username>.github.io.
  • For a project site, use any valid name.

Step 2: Add Your Site Files

Clone the repository to your local machine using:

git clone https://github.com/<username>/<repository-name>.git

Create an index.html file with your desired content. Here’s an example:

<!DOCTYPE html>
<title>My GitHub Page</title>
<h1>Welcome to My Site</h1> 
<p>This is my first GitHub Pages site.</p>

Alternatively, you can use the README.md (markdown) as the index page.

## My Github Page
### Welcome to My Site
THis is my first Github Pages site.

Commit and push your changes to GitHub:

git add .
git commit -m "Initial commit"
git push origin main
how-to-setup-github-pages-static-apps How to Setup and Create GitHub Pages (Serverless Static Apps)

Steps to enable the Github Pages on Github

Step 3: Enable GitHub Pages

  • Go to your repository’s Settings.
  • Click on “Pages” in the sidebar.
  • Under “Source”, select the branch (e.g., main) and folder (if applicable).
  • Click “Save”.

Step 4: View Your Site

  • For personal sites: Visit https://<username>.github.io/.
  • For project sites: Visit https://<username>.github.io/<repository-name>/.

Step 5: Customise Your Site

To add a theme, go to the Pages settings and select “Choose a theme”.

You can also upload additional HTML, CSS, and JavaScript files for further customisation.

Why GitHub Pages are “Serverless Static Apps”

GitHub Pages operate as serverless static apps because they serve pre-built, static HTML, CSS, and JavaScript files directly to the user without relying on backend servers or dynamic content generation at runtime. Instead, the files are hosted on GitHub’s global Content Delivery Network (CDN), ensuring fast and efficient delivery.

Pros:

  • Free hosting with GitHub.
  • No server maintenance required.
  • Fast load times due to CDN distribution.
  • Simplifies deployment and scaling for static sites.

Cons:

  • Limited to static content; no support for server-side functionality like databases.
  • Customisation for advanced workflows requires technical knowledge.
  • Dependency on GitHub’s infrastructure.

Conclusion of Github Pages

GitHub Pages is a fantastic tool for hosting websites for free. With just a few steps, you can create a site for your projects, portfolio, or personal use. By leveraging the serverless model, you can build lightweight, efficient sites with minimal maintenance.

–EOF (The Ultimate Computing & Technology Blog) —

655 words
Last Post: Crypto News: Dogecoin's Rise to Prominence in 2025 (FEMO?)
Next Post: VPS vs Dedicated Servers vs Cloud-Managed Dedicated Servers: Key Differences and Recommendations

The Permanent URL is: How to Setup and Create GitHub Pages (Serverless Static Apps) (AMP Version)

Leave a Reply