Skip to content

CI: make the Storybook deploy check verify the preview is actually live#39

Open
ivoIturrieta wants to merge 1 commit into
mainfrom
ci/verify-pages-live
Open

CI: make the Storybook deploy check verify the preview is actually live#39
ivoIturrieta wants to merge 1 commit into
mainfrom
ci/verify-pages-live

Conversation

@ivoIturrieta

@ivoIturrieta ivoIturrieta commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What

The build-and-deploy check could show green while the deployed preview stayed stale (it happened on #37 today): the workflow's push to gh-pages succeeds, but GitHub's internal Pages publish step can fail transiently afterwards — and legacy Pages does not auto-retry, so the site keeps serving the previous artifact under a passing check.

How

  1. The Storybook artifact is stamped with the workflow run id (build-id.txt)
  2. After deploying, a verify step polls the published URL (PR subdirectory or root) until it serves this run's stamp, with cache-busting — failing after ~10 minutes with recovery instructions (gh api -X POST repos/<repo>/pages/builds re-triggers the publish)

Green now means "this exact build is being served", not "handed off to GitHub".

🤖 Generated with Claude Code


📖 Storybook Preview: https://unlayer.github.io/elements/pr/39/

The build-and-deploy check could pass while the preview stayed stale:
pushing to gh-pages succeeds, but GitHub's own Pages publish step can
fail transiently afterwards — and it does not auto-retry, so the site
keeps serving the previous artifact under a green check.

The artifact now carries a build-id stamp, and a verify step polls the
deployed URL (PR subdirectory or root) until it serves this run's
stamp, failing loudly after ~10 minutes with recovery instructions.
Green now means live.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens the Storybook GitHub Pages deployment workflow so the build-and-deploy check only passes once GitHub Pages is actually serving the newly deployed build (not a stale previous artifact).

Changes:

  • Add a build stamp file (build-id.txt) containing the workflow run_id into the built Storybook output.
  • After deploy, poll the published build-id.txt URL (with cache-busting) until it matches the current run_id, failing after ~10 minutes with recovery instructions.

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

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