Costa Rica
Last updated: 2026-03-26
GitHub Pages is a feature provided by GitHub that allows you to
host static websites directly from a GitHub repository. It's a great way to showcase your projects, create personal websites, or host documentation for your repositories.That means it serves whatever files you put in your repository, without running backend code.
List of References (Click to expand)
- Websites for you and your projects
- Essentials of automated application deployment with GitHub Actions and GitHub Pages
- Microsoft Cloud Sandbox - Unofficial One example was a catalog that aggregated multiple repositories from my GitHub organization. The idea behind it was to create a user‑friendly page that listed all repositories hosted within the organization, while also allowing them to be filtered based on GitHub metadata by Org Catalog (GitHub Pages)
- TechWorkshop L300: Win the database acceleration Example of Workshops documented using GitHub Pages
Table of Content (Click to expand)
Tip
What is GitHub Pages?
GitHub Pages is a free service that turns your GitHub repositories into websites. You can host HTML, CSS, and JavaScript files, and it’s perfect for static websites that don’t require server-side processing. GitHub Pages supports custom domains, making it easy to create a professional-looking website.
- Markdown (.md) → converted to HTML automatically if you use Jekyll.
- HTML, CSS, JavaScript → served directly as static files.
- Jekyll templates (Liquid) → processed by GitHub Pages if you keep Jekyll enabled.
- Static assets → images, fonts, PDFs, JSON, etc.
Note
- If you need dynamic behavior, you can use JavaScript frameworks (React, Vue, Angular) that compile down to static files and deploy them to GitHub Pages.
- For backend logic, you’d need to connect to external APIs or use another service (like Firebase, Supabase, or a traditional server).
- Personal Websites: Showcase your portfolio, resume, or blog.
- Project Documentation: Host documentation for your open-source projects.
- Organization Sites: Create websites for organizations or communities.
- Demo Sites: Share live demos of your projects.
Automate the process of converting Markdown to static HTML and deploying it using GitHub Pages and GitHub Actions
-
Create a GitHub Repository
- Go to GitHub and create a new repository. Name it
username.github.io, whereusernameis your GitHub username. - Make sure the repository is public.
- Go to GitHub and create a new repository. Name it
-
Add Your Markdown Files
- Clone the repository to your local machine.
- Add your Markdown files to the repository.
- Commit and push the changes to GitHub.
-
Create a GitHub Actions Workflow
- In your repository, create a
.github/workflowsdirectory. - Inside this directory, create a file named
md-html-deploy.yml.
- In your repository, create a
-
Define the Workflow: Add the following content to the
md-html-deploy.ymlfile to set up a workflow that converts Markdown to HTML and deploys it to themainbranch:- Checkout Repository: This step checks out your repository so that the workflow can access the files.
- Set up Node.js: This step sets up Node.js, which is required for some Markdown converters.
- Install Dependencies: This step installs the necessary dependencies for your project.
- Convert Markdown to HTML: This step uses
pandocto convert Markdown files to HTML and places them in the_sitedirectory. - Deploy to GitHub Pages: This step commits the generated HTML files back to the
mainbranch and pushes the changes. This ensures that your GitHub Pages site is updated with the latest HTML files.
-
Create a Repository: Create a new repository on GitHub or use an existing one.
-
Enable GitHub Pages:
-
Go to the repository settings on GitHub.
-
Under the
GitHub Pagessection, select themainbranch as the source.
Static HTML refers to web pages that are delivered to the user's browser exactly as stored, without any server-side processing. Static sites are fast, secure, and easy to deploy, making them ideal for simple websites, portfolios, blogs, and documentation.
-
-
Push Your Code: Commit and push your code to the main branch. The GitHub Actions workflow will automatically run and deploy your site to GitHub Pages.