Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GH Pages setup example to include the latest actions version #27061

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/snippets/common/ghp-github-action.yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ jobs:
# Set up Node
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '20.x'

# If using Yarn Modern, you also need to add the following action to install your configured Yarn version:
# - name: Install Yarn
# run: corepack enable && yarn install
Comment on lines +30 to +34
Copy link
Contributor

Choose a reason for hiding this comment

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

@esimkowitz If you're ok with it, could you move the Corepack step above? Before the node setup action, turning it into something as follows:

name: "Build and Publish Storybook to GitHub Pages"

on:
  push:
    branches:
      - 'your-branch-name' # Replace with the branch you want to deploy from

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      # Enable the steps below if you're working with Corepack's supported package managers (e.g. Yarn 2+, pnpm)
      #- name: Enable Corepack
      #  run: corepack enable
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: yarn install
      - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
        with:
          install_command: yarn install # default: npm ci
          build_command: yarn build-storybook # default: npm run build-storybook
          path: storybook-static # default: dist/storybook
          checkout: false # default: true

Copy link
Author

Choose a reason for hiding this comment

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

I think corepack is bundled with Nodejs, I haven't tested if it's available before NodeJS gets installed


#馃憞 Add Storybook build and deploy to GitHub Pages as a step in the workflow
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
Expand Down