Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload-cloud

GitHub Action

HubSpot CMS Deploy

v1.2 Pre-release

HubSpot CMS Deploy

upload-cloud

HubSpot CMS Deploy

Publish website files to your HubSpot CMS account

Installation

Copy and paste the following snippet into your .yml file.

              

- name: HubSpot CMS Deploy

uses: HubSpot/hubspot-cms-deploy-action@v1.2

Learn more about this action in HubSpot/hubspot-cms-deploy-action

Choose a version

HubSpot CMS Deploy Action

Automatically deploy a HubSpot CMS project to your account 🚀

Usage

In your GitHub repo, create two new secrets for:

  • HUBSPOT_PORTAL_ID - This is your HubSpot account ID
  • HUBSPOT_PERSONAL_ACCESS_KEY - Your personal access key

This guide walks through setting up a new workflow file that automatically uploads new changes on your main branch to your HubSpot CMS account. If you're adding a deployment step to an existing workflow, you can skip ahead.

  1. In your project, create a GitHub Action workflow file at .github/workflows/main.yml
  2. Copy the following example workflow into your main.yml file.
on:
  push:
    branches:
    - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.3
      - name: HubSpot Deploy Action
        uses: HubSpot/hubspot-cms-deploy-action@v.1.1
        with:
          src_dir: <src>
          dest_dir: <src>
          portal_id: ${{ secrets.hubspot_portal_id }}
          personal_access_key: ${{ secrets.hubspot_personal_access_key }}
  1. Replace the src_dir with the directory of your CMS project in your repo
  2. Replace the dest_dir with the directory it should be uploaded to in your target account
  3. Commit and merge your changes

Note: Do not change the portal_id or personal_access_key values in your workflow. Auth related values should only be stored as GitHub secrets.

Integrating into an existing workflow

To add HubSpot CMS deployment as a step in an existing GitHub Action workflow, add the following step:

- name: HubSpot Deploy Action
  uses: HubSpot/hubspot-cms-deploy-action@v.1.1
  with:
    src_dir: <src>
    dest_dir: <src>
    portal_id: ${{ secrets.hubspot_portal_id }}
    personal_access_key: ${{ secrets.hubspot_personal_access_key }}

Action Spec

Inputs

  • src_dir - Project directory in repo
  • dest_dir - Target directory in HubSpot

Secrets

  • HUBSPOT_PORTAL_ID - Target account id
  • HUBSPOT_PERSONAL_ACCESS_KEY - Authentication key