Add path filtering to Shopify theme workflows#3
Merged
Conversation
- PR preview workflow now only runs when theme files change - Deploy workflow only runs when theme files change (manual dispatch still unrestricted) - Prevents unnecessary CI runs and Shopify theme creation for docs-only changes - Follows same pattern as docs-deploy.yml path filtering Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Preview theme deployedTheme: PR #3 - workflow-path-filtering
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Optimizes GitHub Actions workflows by adding path filtering to prevent unnecessary CI runs and Shopify theme creation for docs-only or non-theme changes.
The Problem
Currently, both
pr-preview.ymlanddeploy.ymlrun on EVERY change, including:This wastes CI time and creates unnecessary Shopify preview themes.
The Solution
Add
pathsfilters to both workflows so they only run when theme files actually change.Changes
.github/workflows/pr-preview.ymlpathsfilter topull_requesttrigger.github/workflows/deploy.ymlpathsfilter topushtriggerworkflow_dispatchremains unrestricted for manual deploysPath Filters Applied
Both workflows now only trigger when these files change:
theme/**- All Shopify theme filesvite.config.js- Build configurationjsconfig.json- Path aliasespackage.json- Dependenciespnpm-lock.yaml- Lock file.github/workflows/[workflow-name].yml- Workflow file itselfBenefits
✅ Reduced CI noise - No Shopify preview themes for docs-only PRs
✅ Faster feedback - Skip unnecessary builds
✅ Cost optimization - Fewer CI minutes used
✅ Follows existing patterns - Matches
docs-deploy.ymlapproachImportant Note
GitHub Actions workflows run from the base branch (main), not the PR branch. This is a security feature. Once this PR is merged, subsequent PRs will use the filtered workflows.
How to Test After Merge
docs/**files)pr-preview.ymldoes NOT rundocs-deploy.ymlDOES runtheme/**files)pr-preview.ymlDOES runManual Override
Manual deploys via
workflow_dispatchstill work regardless of changed files.Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com