Skip to content

Commit

Permalink
Update Chromatic deployment action, to only deploy when needed.
Browse files Browse the repository at this point in the history
Refactored the Chromatic deployment GitHub Action to enhance deployment
efficiency by ensuring actions only run when necessary.
Up until now, it triggered on every single push, regardless if the push
was made against an active pull request or not.

The workflow now triggers on push events for the main, develop, and
release/* branches, and on specific pull_request events. Added
concurrency control to prevent duplicate workflows from running
simultaneously by canceling in-progress actions if a new relevant event
occurs. These changes improve deployment efficiency, consistency, and
hopefully means we won't exceed the tokens as often.
  • Loading branch information
rasben committed May 28, 2024
1 parent 6d70eea commit 6ab7420
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: "Chromatic"
name: 'Chromatic'

on:
push:
branches:
# Required for creating baselines
- main
- develop
- release/*
pull_request:
types: [ready_for_review, opened, synchronize]

# Detect if this action is already running, and cancel it.
# This most likely happened because a second push has been made to a branch.
concurrency:
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on: push
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6ab7420

Please sign in to comment.