Deploying to GitHub Pages

GitHub Pages is a popular hosting option for static sites. GitHub Pages can be configured in <your-repo> > Settings > Pages.

Build Configuration

GitHub Pages offers a few build options:

  • GitHub Actions
  • Deploy from a branch

Figure: GitHub Actions

We want to choose "GitHub Actions" so that we can control the build script, and make sure it's also building the TinaCMS admin

By clicking "Configure" on the action it's created for us, we can then tweak the build script to build tinacms along with our site.

Add the following step before your site's build step:

Your GitHub Action will look something like:

Figure: GitHub Action

Common Issues

Common Issue: 'Missing script: "tinacms"'


Common Issue: /admin is giving a 404


Common Issue: The root URL is giving a 404

Environment variables

Assuming that your TinaCMS clientID and token are setup as environment variables, you will need to add those to the GitHub Secrets for your project. The secrets we used in the code snippet above were TINA_PUBLIC_CLIENT_ID & TINA_TOKEN.

Last Edited: February 19, 2025