Skip to content

Commit

Permalink
Merge pull request #29430 from storybookjs/kasper/fix-sandboxes-next
Browse files Browse the repository at this point in the history
Nextjs: Make sure Next 14 is used for sandboxes
  • Loading branch information
kasperpeulen authored Oct 24, 2024
2 parents eb2200c + 63ddd1c commit 99b7c67
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 56 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/generate-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
workflow_dispatch:
# To test fixes on push rather than wait for the scheduling, do the following:
# 1. Uncomment the lines below and add your branch.
push:
branches:
- kasper/fix-sandboxes-next
# push:
# branches:
# - <your-branch-name>
# 2. Change the "ref" value to <your-branch-name> in the actions/checkout step below.
# 3. Comment out the whole "generate-main" job starting at line 77
# 4. 👉 DON'T FORGET TO UNDO THE STEPS BEFORE YOU MERGE YOUR CHANGES!
Expand All @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: kasper/fix-sandboxes-next
ref: next

- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -74,54 +74,54 @@ jobs:
The generation of some or all sandboxes on the **next** branch has failed.
[See the job summary for details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
# generate-main:
# name: Generate to main
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# ref: main
#
# - uses: actions/setup-node@v4
# with:
# node-version-file: ".nvmrc"
#
# - name: Setup git user
# run: |
# git config --global user.name "storybook-bot"
# git config --global user.email "32066757+storybook-bot@users.noreply.github.com"
#
# - name: Install dependencies
# working-directory: ./scripts
# run: node --experimental-modules ./check-dependencies.js
#
# - name: Compile Storybook libraries
# run: yarn task --task compile --start-from=auto --no-link
#
# - name: Publish to local registry
# run: yarn local-registry --publish
#
# - name: Run local registry
# run: yarn local-registry --open &
#
# - name: Wait for registry
# run: yarn wait-on tcp:127.0.0.1:6001
#
# - name: Generate
# id: generate
# run: yarn generate-sandboxes --local-registry
#
# - name: Publish
# # publish sandboxes even if the generation fails, as some sandboxes might have been generated successfully
# if: ${{ !cancelled() }}
# run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT }}@github.com/storybookjs/sandboxes.git --push --branch=main
#
# - name: Report failure to Discord
# if: failure()
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }}
# uses: Ilshidur/action-discord@master
# with:
# args: |
# The generation of some or all sandboxes on the **main** branch has failed.
# [See the job summary for details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
generate-main:
name: Generate to main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Setup git user
run: |
git config --global user.name "storybook-bot"
git config --global user.email "32066757+storybook-bot@users.noreply.github.com"
- name: Install dependencies
working-directory: ./scripts
run: node --experimental-modules ./check-dependencies.js

- name: Compile Storybook libraries
run: yarn task --task compile --start-from=auto --no-link

- name: Publish to local registry
run: yarn local-registry --publish

- name: Run local registry
run: yarn local-registry --open &

- name: Wait for registry
run: yarn wait-on tcp:127.0.0.1:6001

- name: Generate
id: generate
run: yarn generate-sandboxes --local-registry

- name: Publish
# publish sandboxes even if the generation fails, as some sandboxes might have been generated successfully
if: ${{ !cancelled() }}
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT }}@github.com/storybookjs/sandboxes.git --push --branch=main

- name: Report failure to Discord
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }}
uses: Ilshidur/action-discord@master
with:
args: |
The generation of some or all sandboxes on the **main** branch has failed.
[See the job summary for details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
2 changes: 1 addition & 1 deletion code/lib/cli-storybook/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const baseTemplates = {
'nextjs/default-js': {
name: 'Next.js Latest (Webpack | JavaScript)',
script:
'npx create-next-app@^14 {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',
'npx create-next-app@^14 {{beforeDir}} --eslint --tailwind --app --import-alias="@/*" --src-dir',
expected: {
framework: '@storybook/nextjs',
renderer: '@storybook/react',
Expand Down

0 comments on commit 99b7c67

Please sign in to comment.