---
title: "Compare on Every Push"
sidebarTitle: "Compare on Every Push"
description: "Turn on automatic comparisons in deeepSpace: every push to your GitHub repository syncs your components and compares them with their Figma design, on your repository's GitHub Actions."
keywords: "automatic design comparison, deeep sync ci, github actions design comparison, ci token, DEEEP_TOKEN"
icon: "workflow"
---

With **automatic comparisons** on, every push to the branch your project follows syncs the project and compares the changed components with their design. Nobody has to run `deeep sync` by hand: a changed component shows **Comparing…**, then its new result a few minutes later.

The build runs on your repository's **GitHub Actions**, which already has your code and dependencies. deeepSpace sets it up for you, and you can pause or remove it from deeepSpace at any time.

## Before you begin

- The project is connected to a **GitHub** repository in deeepSpace. For GitLab, Bitbucket or another CI service, see [Set it up yourself](#set-it-up-yourself).
- You have run `deeep sync` once from your machine (or committed `deeep.json`), so deeepSpace knows how to find your components.
- You are an **owner or creator** of the project's workspace, and an **admin** of the GitHub repository. Adding a secret and a workflow needs repository admin rights.

## Turn it on

<Steps>
  <Step title="Flip the switch">
    In deeepSpace, open the project's settings → **Automation**, and turn on **Automatic comparisons**.
  </Step>

  <Step title="Allow workflows on GitHub (once)">
    The first time, GitHub asks you to allow deeepSpace to **update GitHub Action workflows**. Select **Authorize**: you come back to the same tab, and the setup carries on.
  </Step>

  <Step title="Merge the pull request">
    deeepSpace opens a pull request in your repository that adds `.github/workflows/deeep.yml`, plus `deeep.json` when the repository doesn't have it yet. Select **Open the pull request** and merge it on GitHub.
  </Step>
</Steps>

The card then says **On: every push to main is compared**, with the result of the last run.

Behind the scenes, deeepSpace creates a **CI token** for the project and saves it as the repository's `DEEEP_TOKEN` secret. You never see or copy it.

## Pause, resume or remove it

- **Pause:** turn the switch off. Pushes aren't compared; nothing changes on GitHub. Each run checks deeepSpace first and ends in seconds, green.
- **Resume:** turn the switch on again. The next push is compared.
- **Remove from repository:** revokes the token, deletes the `DEEEP_TOKEN` secret and opens a pull request that removes the workflow. Merge it to take the file out.

## Set it up yourself

For another CI service, or to set up GitHub Actions by hand, use **Automation** → **Set it up yourself**.

<Steps>
  <Step title="Create a CI token">
    Name the token (for example *GitHub Actions*) and select **Create token**. Copy it: it's shown only once.
  </Step>

  <Step title="Add it to the repository as a secret">
    On GitHub, open the repository's **Settings** → **Secrets and variables** → **Actions** → **New repository secret**. Name it `DEEEP_TOKEN` and paste the token.
  </Step>

  <Step title="Add the workflow">
    Commit this file as `.github/workflows/deeep.yml`, along with `deeep.json`. The tab gives it with your project's branch and the latest CLI release filled in, for npm, pnpm, Yarn or Bun.

    ```yaml .github/workflows/deeep.yml
        # deeepSpace: sync and compare the design system on every push.
        # Pause, resume, update or remove it in deeepSpace: Project settings → Automation.
        # deeepSpace workflow revision 2.
        name: deeep

        on:
          push:
            branches: [main]
          workflow_dispatch:

        permissions:
          contents: read

        # A newer push replaces a run that hasn't finished.
        concurrency:
          group: deeep-${{ github.ref }}
          cancel-in-progress: true

        env:
          # The deeep CLI release this workflow installs, and its SHA-256 (from
          # deeepSpace's signed release list): any other file stops the run.
          DEEEP_CLI_VERSION: "1.6.5"
          DEEEP_CLI_SHA256: "8b81c0347ef4fca312620b95d5cc75ebd79187ab37f5b8ada50664e794db5f63"

        jobs:
          sync:
            runs-on: ubuntu-latest
            # A stuck run stops here instead of using up Actions minutes.
            timeout-minutes: 30
            steps:
              - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
                with:
                  # deeep sync reads the history: each component's last change, and
                  # the package versions it was built with.
                  fetch-depth: 0
                  # Nothing here pushes: Git keeps no GitHub token.
                  persist-credentials: false
              - name: Install the deeep CLI
                run: |
                  archive="$RUNNER_TEMP/deeep-cli.tar.gz"
                  curl --proto '=https' --tlsv1.2 -fsSL --retry 3 -o "$archive" "https://cloud.deeepspace.com/deeep-cli/releases/v1.6.5/deeep-linux-x86_64.tar.gz"
                  echo "$DEEEP_CLI_SHA256  $archive" | sha256sum --check --strict -
                  tar -xzf "$archive" -C "$RUNNER_TEMP"
                  echo "$RUNNER_TEMP/deeep" >> "$GITHUB_PATH"
              # Paused in deeepSpace: the run ends here, green.
              - name: Check deeepSpace
                id: deeep
                run: deeep ci check
                env:
                  DEEEP_TOKEN: ${{ secrets.DEEEP_TOKEN }}
              - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
                if: steps.deeep.outputs.enabled == 'true'
                with:
                  node-version: "24"
                  cache: npm
              - run: npm ci
                if: steps.deeep.outputs.enabled == 'true'
              - name: Sync and compare
                if: steps.deeep.outputs.enabled == 'true'
                run: deeep sync
                env:
                  DEEEP_TOKEN: ${{ secrets.DEEEP_TOKEN }}
    ```
  </Step>
</Steps>

### Other CI services

Any CI service works. In the job:

1. Check out the repository (a branch, not a detached commit) and install your dependencies.
2. Install one CLI release and check its SHA-256 before running it. Take the version and checksum from the workflow in **Automation** → **Set it up yourself** (the build for Linux x86_64):
   ```bash
   curl --proto '=https' --tlsv1.2 -fsSL -o deeep-cli.tar.gz "https://cloud.deeepspace.com/deeep-cli/releases/v$DEEEP_CLI_VERSION/deeep-linux-x86_64.tar.gz"
   echo "$DEEEP_CLI_SHA256  deeep-cli.tar.gz" | sha256sum --check --strict -
   tar -xzf deeep-cli.tar.gz
   export PATH="$PWD/deeep:$PATH"
   ```
3. Run `deeep sync` with `DEEEP_TOKEN` set from the service's secret variables.

## Keep the workflow up to date

The workflow installs one exact release of the deeep CLI and checks its SHA-256 before running it, so a run never picks up a new version by itself. Its actions are pinned to exact commits too.

When a newer CLI is out, or deeepSpace's workflow changes, **Automation** shows the update before you decide:

- **What changes for you**, in plain words, and what stays the same (your `DEEEP_TOKEN` secret, the branch, when it runs).
- A **Security fix** or **Recommended** label.
- **See the exact file changes**: the lines of `.github/workflows/deeep.yml` that are removed and added.

**Update the workflow** opens a pull request with the same notes; nothing changes until you merge it. **Not now** hides the update until a newer one comes out. A security fix stays as a one-line reminder.

Your current workflow keeps working if you don't update: the CLI release it pins stays available.

## What a run does

1. Asks deeepSpace whether automatic comparisons are paused (`deeep ci check`). If they are, the run ends there, green.
2. Syncs the components found in the commit that was pushed.
3. With Storybook discovery, builds Storybook first: a fresh checkout has no build. That's why the workflow installs your dependencies before `deeep sync`.
4. Builds the component previews and starts the design comparison. Components that didn't change keep their results.

The run fails when the sync fails (a revoked token, a missing `deeep.json`, a Storybook build that fails). Problems with Storybook hosting or the design comparison don't fail it, since your components were synced, but they show as warnings on the run's summary page.

## How a CI token is kept safe

- It works **only for its project**, and only for what a sync does: reading the project's details, syncing components, updating the project's stack settings and uploading builds. It can't read other projects, the workspace's members, your account, or manage tokens.
- It acts as **the member who created it**: if they leave the workspace, are no longer an owner or creator, or their account is blocked or deleted, the token stops working. Create a new one from another member's account.
- Signing out or changing your password doesn't end a CI token, as with tokens on other services: revoke it if it may have leaked.
- Only a fingerprint of it is stored: deeepSpace can't show it again. **Automation** → **Set it up yourself** lists each token with who created it and when it was last used.
- **Revoke** a token you no longer use, or one that may have leaked. Runs using it stop at once.
- A read-only workspace (trial ended, subscription canceled) refuses CI runs, like other CLI use.

## Troubleshooting

#### "GitHub permission needed"
deeepSpace can't add workflow files yet. Select **Allow on GitHub** and authorize it.

#### "A repository admin is needed"
Only a repository admin can add the secret and the workflow. Ask one to turn automatic comparisons on, or to give you admin rights.

#### "Run deeep sync once from your machine first"
deeepSpace doesn't know your component setup yet. Run `deeep init` and `deeep sync` once, then turn it on again.

#### "The pull request was closed without merging it"
Turn automatic comparisons on again to open a new one.

#### The run stops at "Install the deeep CLI" with "checksum did NOT match"

The downloaded file isn't the release the workflow names, so it isn't run. Run the workflow again. If it fails again, select **Update the workflow** in **Automation**, or copy the workflow from **Set it up yourself** again.

#### The run ends at "Check deeepSpace"
Automatic comparisons are paused. Turn the switch on in **Automation**.

#### "deeepSpace refused the CI token"
The token was revoked or doesn't exist. Create a new one in **Automation** and update the `DEEEP_TOKEN` secret.

#### "DEEEP_TOKEN isn't a deeepSpace CI token"
The secret holds something else. CI tokens start with `deeep_ci_`.

#### "Authentication required: Set DEEEP_TOKEN"
The secret isn't passed to the step. Check the `env:` block and the secret's name.

#### "No project linked"
`deeep.json` isn't in the commit. Run `deeep init` on your machine and commit `deeep.json`.

#### "This CI token belongs to another project"
`deeep.json` links another project than the token's. Use the token of the project in `deeep.json`.

#### "Storybook's dependencies aren't installed"
Install your dependencies in a step before `deeep sync`.

#### "The repository is in detached HEAD state"
Check out a branch: `actions/checkout` does on a push. Other services may need `git checkout <branch>` first.
