How can I build and deploy a full HubSpot CMS website through GitHub (client wants all changes to pass via GitHub)?
04:40 07 Nov 2025

I’ve been asked to develop a complete website on HubSpot CMS, but my client wants every update and deployment to pass through GitHub — meaning no direct edits in HubSpot, only version-controlled changes pushed from GitHub.

I understand HubSpot provides a local development workflow using the HubSpot CLI, but I’m not sure how to properly connect it with GitHub so the process is automated and safe for production.

Here’s what I’m trying to figure out:

  1. How do I set up a proper workflow where:

    • I can develop locally (with HubSpot CLI),

    • Push code to a GitHub repository,

    • Then have changes automatically deployed to HubSpot from GitHub (for example, via GitHub Actions or CI/CD pipeline).

  2. How do I handle multiple environments — for example, a sandbox HubSpot account for development and a production account for live deployment?

  3. What is the recommended authentication method for CI/CD — a HubSpot private app token, or is there a better approach for automation?

  4. Are there any best practices to ensure the HubSpot theme or modules remain in sync with GitHub and don’t get overwritten by manual edits inside HubSpot?

Basically, I want to set up a developer-friendly workflow like this:

Local dev → GitHub commit/push → GitHub Action → Deploy to HubSpot account

If anyone has already done this or can share an example of a GitHub Actions YAML file or HubSpot CLI configuration (hubspot.config.yml) for CI/CD, it would be really helpful.

I’ve checked the HubSpot documentation and CLI guides, but they mostly cover local development. I’m looking for a real-world setup or example of using GitHub for version control and deployment to HubSpot CMS.

git github-actions hubspot-api hubspot-cms