Skip to content
Latchkey

How to Store Visual Baselines With reg-suit and S3 in CI

reg-suit stores expected images in an S3 bucket instead of git, downloading the baseline for the base commit and uploading a diff report each run.

Configure reg-publish-s3-plugin in regconfig.json, provide AWS credentials as secrets, and run reg-suit run so baselines live in S3 rather than the repo.

Steps

  • Install reg-suit and reg-publish-s3-plugin.
  • Set the bucket in regconfig.json.
  • Provide AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY secrets.
  • Run reg-suit run after generating actual images.

regconfig.json

regconfig.json
{
  "core": { "workingDir": ".reg", "actualDir": "actual" },
  "plugins": {
    "reg-publish-s3-plugin": { "bucketName": "my-visual-baselines" }
  }
}

Workflow

.github/workflows/ci.yml
jobs:
  visual:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run capture-screenshots
      - run: npx reg-suit run
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Gotchas

  • reg-suit keys baselines by commit hash; a shallow clone breaks base-commit lookup.
  • The IAM policy must allow both read and write on the bucket prefix.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →