Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/digital-domain/llms.txt

Use this file to discover all available pages before exploring further.

GitHub Pages is the natural home for a portfolio SPA like Digital Domain — it is free, requires zero infrastructure, and lives right alongside your source code. Because the repo already commits its built output to the root directory, you can have a live site running in under two minutes by flipping a single setting in your repository. For ongoing development with automated deploys, a GitHub Actions workflow can rebuild and publish on every push to main. This guide covers both approaches, plus the SPA routing fix required for React Router deep links to work correctly.

Prerequisites

  • A GitHub account with the repository pushed to GitHub
  • Node.js 18 or later installed locally (only required for Option 2 with a custom dev environment)
  • The repository must be public, or your account must have a GitHub Pro / Team plan for private-repo Pages

Option 1: Deploy from the Existing Repo (Instant)

Since all built files are already committed to the repo root, you can enable GitHub Pages with no build step at all.
1

Open repository Settings

Navigate to your repository on GitHub and click the Settings tab in the top navigation.
2

Configure the Pages source

In the left sidebar, click Pages. Under Build and deployment, set:
  • Source: Deploy from a branch
  • Branch: main
  • Folder: / (root)
Click Save.
3

Wait for the first deployment

GitHub will begin deploying immediately. After about 60 seconds, a banner at the top of the Pages settings screen will show your live URL: https://your-username.github.io/digital-domain/.
The .nojekyll file already committed to the repo root ensures GitHub does not run Jekyll processing, which would otherwise interfere with the asset paths in index.html.

Option 2: GitHub Actions Workflow (Automated)

For a workflow where you modify source files and want automated deploys on every push, use a GitHub Actions pipeline that installs dependencies, builds the project, and publishes the dist/ output.
This option requires a local Vite + Tailwind development environment with a package.json and vite.config.js. Neither file is committed to the repo — the repo contains pre-built output only. You must set up your own dev environment before this workflow will function. See the deployment overview for scaffolding steps, and the Tailwind Config page for the example Tailwind configuration.
Create the following file in your repository:
# .github/workflows/deploy.yml
name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - run: npm install

      - run: npm run build

      - uses: actions/upload-pages-artifact@v3
        with:
          path: dist

      - uses: actions/deploy-pages@v4
After committing this file, go to Settings → Pages and change the source to GitHub Actions. Every subsequent push to main will trigger a fresh build and deploy automatically.

SPA Routing Fix

The .nojekyll file handles Jekyll interference, but there is a second problem: React Router’s BrowserRouter uses the HTML5 History API, meaning URLs like /blog and /skills are not real files on disk. When GitHub Pages receives a request for /blog it returns a 404 because no blog/index.html exists. The standard workaround is a 404.html that captures the requested URL and redirects back to index.html, where React Router takes over and renders the correct route. Step 1 — Create 404.html in the repo root (for the pre-built deploy) or in public/ (for a Vite build setup):
<!-- 404.html -->
<!DOCTYPE html>
<html>
<head>
  <script>
    sessionStorage.redirect = location.href;
  </script>
  <meta http-equiv="refresh" content="0;URL='/digital-domain/'">
</head>
</html>
Step 2 — Add the redirect handler to index.html just before the closing </body> tag:
<!-- index.html -->
<script>
  (function() {
    var redirect = sessionStorage.redirect;
    delete sessionStorage.redirect;
    if (redirect && redirect !== location.href) {
      history.replaceState(null, null, redirect);
    }
  })();
</script>
When a visitor lands on a deep link, GitHub Pages serves 404.html, which saves the original URL to sessionStorage and immediately redirects to the app root. Once index.html loads, the inline script reads the saved URL from sessionStorage and uses history.replaceState to restore it — React Router then renders the correct page without a visible redirect.

Custom Domain

To use your own domain (e.g. www.yourdomain.com) instead of the default github.io subdomain:
1

Add a CNAME file

Create a file named CNAME in the repo root containing only your domain name:
www.yourdomain.com
2

Configure your DNS

With your domain registrar or DNS provider, add a CNAME record pointing www to your-username.github.io. For an apex domain, add A records pointing to GitHub’s Pages IPs (listed in GitHub’s documentation).
3

Set the custom domain in repo Settings

Under Settings → Pages → Custom domain, enter your domain and click Save. GitHub will attempt to verify it and provision an HTTPS certificate via Let’s Encrypt.
By default, GitHub Pages serves the site from https://username.github.io/digital-domain/ — note the /digital-domain/ subdirectory path, not the root. If React Router links or asset paths are not accounting for this prefix, navigation will break. The pre-built assets/main.js in the committed repo is already compiled with this base path. If you set up your own build environment and need to adjust the base path, set Vite’s base option in your vite.config.js:
// vite.config.js (example — not present in the repo)
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  base: '/digital-domain/',
  plugins: [react()],
});
If you are deploying to a custom domain at the root (e.g. https://www.yourdomain.com/), set base: '/' instead.
GitHub Pages is completely free for public repositories with no bandwidth caps for reasonable traffic — making it the perfect zero-cost home for a portfolio site. Pair it with a custom .dev or .io domain from your registrar (typically $10–15/year) and you have a professional portfolio URL with HTTPS, global CDN delivery via Fastly, and zero monthly hosting costs.

Build docs developers (and LLMs) love