Skip to content

Conversation

rocketnova
Copy link
Contributor

Ticket

#97

Changes

What was added, updated, or removed in this PR.

  • Update regex for storybook string replacement to support deploying to a subdirectory

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

I deployed #89 to WIC MT Demo Project in order to get our storybook deployed using github pages. I found an issue where the images weren't displaying properly and made a PR for it: navapbc/wic-mt-demo-project-eligibility-screener#168 This PR is a port of that one.

See also Slack discussion: https://nava.slack.com/archives/C03G1SWD9H7/p1669820652173809

I inspected the generated github action artifact and confirmed that we are currently correctly prepending the BASE_PATH to any relative paths in storybook that begin with url(/. However, USWDS also uses this syntax url("/ and our regex doesn't catch that.

Testing

Screenshots, GIF demos, code examples or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

  1. Go to this github action run, which builds storybook for this branch and deploys it to github pages
  2. Download the generated artifact
  3. Unzip the artifact
  4. Grep the unzipped files and confirm that "/uswds/img does not appear and that "template-application-nextjs/uswds/img does appear

@rocketnova rocketnova requested a review from sawyerh December 6, 2022 22:09
@sawyerh sawyerh temporarily deployed to github-pages January 27, 2023 00:20 — with GitHub Actions Inactive
@sawyerh sawyerh merged commit b9b14cc into main Jan 27, 2023
@sawyerh sawyerh deleted the rocket/97-gh-storybook-images branch January 27, 2023 00:24
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