Search code examples
htmlcssgithubgithub-pagesreadme

How do I host my portfolio website on GitHub?


I am trying to host my website on GitHub.

It consists of multiple HTML files (homepage.html, projectpage.html, images folder etc.) and a CSS file. However, when I publish it, only the README is shown and not my HTML web pages.

How do I host my website on GitHub?


Solution

  • Using GitHub Pages:

    1. Upload all files to GitHub repository. Name the homepage index.html
    2. In the top horizontal bar, click Settings
    3. Click on Pages in the sidebar
    4. Under Branch, click the dropdown which currently says None ▼ and click main or master
    5. Click Save

    Your site is now published at username.github.io/repo.


    Using Vercel's free plan which gives you a customisable subdomain:

    1. Upload all files to GitHub repository. Name the homepage index.html
    2. Sign up to Vercel for free using your GitHub account
    3. Create a new deploy
    4. Under Import Git Repository, click Import on the repository you just created
    5. Edit the Project Name to whatever you wish
    6. Click Deploy

    Vercel will start building your site. It will be hosted at projectname.vercel.app