Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

[Bug] Github Actions: build-storybook fails with no such directory #125

@chandlervdw

Description

@chandlervdw

Build step fails when deploying via GH Actions

With a workflow like this:

name: Deploy Storybook to Github Pages
on:
  push:
    branches:
      - main
      
jobs:
  Deploy-Storybook:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Install 🔧
        run: yarn install
        
      - name: Build & Deploy Storybook 🚀
        run: yarn run deploy-storybook -- --ci
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}

I get the following error during the build-storybook step, where foo is the repo:

Error: Exec code(1) on executing: npm run build-storybook -- -o out6551
info @storybook/react v6.5.9
info 
info => Cleaning outputDir: /home/runner/work/foo/foo/out6551
info => Loading presets
/home/runner/work/foo/foo/node_modules/@storybook/core-server/dist/cjs/utils/server-statics.js:109
    throw new Error((0, _tsDedent.default)((0, _chalk.default)`
          ^

Error: Failed to load static files, no such directory: /home/runner/work/foo/foo/public
Make sure this directory exists, or omit the -s (--static-dir) option.

I've even tried this with

      - name: Build & Deploy Storybook 🚀
        run: yarn run deploy-storybook -- --ci
        env:
          GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

Steps to reproduce the behavior

  1. Create a new GH Actions workflow using the template above with the latest version of this npm package installed
  2. Push to your main branch or tweak the workflow

Expected behavior

It should successfully deploy to gh-pages

Environment

  • OS: ubuntu-latest GH Actions CI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions