Skip to content

fix(ci): stabilize Storybook GitHub Pages deploys#20819

Draft
vpomerleau wants to merge 1 commit into
mainfrom
chore/storybook-deploy-reliability
Draft

fix(ci): stabilize Storybook GitHub Pages deploys#20819
vpomerleau wants to merge 1 commit into
mainfrom
chore/storybook-deploy-reliability

Conversation

@vpomerleau

@vpomerleau vpomerleau commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Because

  • The deploy-to-Pages job has failed on nearly every run for days, hidden by continue-on-error: true (workflow still shows green).
  • Two independent causes: concurrent runs collide on GitHub's one-deployment-per-environment limit (HTTP 400), and the sync step times out as the gh-pages site grows past ~2 GB with unbounded open-PR storybooks.

This pull request

  • Serializes the deploy job with its own gh-pages-publish concurrency group so runs stop racing the Pages environment.
  • Extends cleanup to prune stale open-PR storybooks and cap how many are retained, keeping the site small enough to finish syncing.

Issue that this pull request solves

Closes: N/A

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

  • Chore-only CI fix, no Jira ticket; pre-merge review waived (workflow YAML only, no runtime code).
  • Not exercised by this PR's own CI — YAML-only diff means no Storybook projects are "affected", so the deploy job skips; effective on main after merge.
  • To recover deploys right after merge, run Actions → Cleanup Storybooks → Run workflow instead of waiting for the daily cron.
  • Prune thresholds are tunable env vars: MAX_AGE_DAYS (14), MAX_KEEP (15).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stabilizes Storybook preview publishing to GitHub Pages by preventing concurrent Pages deployments from colliding and by keeping the published gh-pages content from growing without bound (which has been causing deploy sync timeouts).

Changes:

  • Serialize the Pages publish step by adding a dedicated gh-pages-publish concurrency group to the deploy job.
  • Extend the cleanup workflow to remove storybooks for stale open PRs and enforce a maximum number of retained PR storybook directories.
  • Update cleanup commit messaging to reflect broader pruning behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/deploy-storybooks.yml Adds a dedicated concurrency group to serialize GitHub Pages publishes.
.github/workflows/cleanup-storybooks.yml Prunes stale open-PR storybooks and enforces a retention cap to keep the Pages payload bounded.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/deploy-storybooks.yml Outdated
Comment thread .github/workflows/cleanup-storybooks.yml Outdated
@vpomerleau vpomerleau force-pushed the chore/storybook-deploy-reliability branch from de30a24 to 378a8e6 Compare July 3, 2026 18:35
@vpomerleau vpomerleau requested a review from Copilot July 3, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +61 to +63
else
echo "::warning::Keeping pr-${PR_NUMBER}: PR lookup failed, will retry next run (${META})"
fi
REMOVED=$((REMOVED + 1))
else
echo "Keeping storybook for PR #${PR_NUMBER} (state: ${STATE})"
KEPT+=("${UPDATED_TS} ${PR_NUMBER} ${dir}")
Because:
 - The deploy-to-Pages job fails intermittently: concurrent runs collide on
   the single Pages environment, and the sync step times out as the gh-pages
   site grows unbounded with open-PR storybooks.

This commit:
 - Serializes the deploy job with its own concurrency group.
 - Prunes stale open-PR storybooks and caps how many are retained.
@vpomerleau vpomerleau force-pushed the chore/storybook-deploy-reliability branch from 378a8e6 to d7c245b Compare July 3, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants