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

[Bug] Error running yarn deploy-storybook to s3 in github action #100

Open
fspaniol opened this issue Jan 22, 2021 · 0 comments
Open

[Bug] Error running yarn deploy-storybook to s3 in github action #100

fspaniol opened this issue Jan 22, 2021 · 0 comments
Labels

Comments

@fspaniol
Copy link

Describe the bug

Hi there, I'm trying to automate the deploy of my storybook to S3, and, while it works locally, it's failing in the Github Action.

Steps to reproduce the behavior

My current command for deploy-storybook:

"deploy-storybook": "storybook-to-aws-s3 --ci --bucket-path=<my-bucket> --s3-sync-options='--delete'"

This is the my current action:

name: Storybook to S3

on:
  push:
    branches:
      - '*'

env:
  CI: true

jobs:
  Storybook:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: borales/[email protected]
        with:
          cmd: install
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-1
      - name: Deploy storybook
        uses: borales/[email protected]
        with:
          cmd: deploy-storybook

It fails with the following:

$ storybook-to-aws-s3 --ci --bucket-path=<my-bucket> --s3-sync-options='--delete'
=> Building storybook for: ui
   executing: npm run build-storybook -- -o out8987
=> Deploying storybook
   executing: aws --profile default s3 sync out8987 s3://<my-bucket>/ --delete
/github/workspace/node_modules/@storybook/storybook-deployer/src/utils.js:14
  throw new Error(
  ^

Error: Exec code(127) on executing: aws --profile default s3 sync out8987 s3://<my-bucket>/ --delete
/bin/sh: aws: not found

    at Object.exec (/github/workspace/node_modules/@storybook/storybook-deployer/src/utils.js:14:9)
    at Object.<anonymous> (/github/workspace/node_modules/@storybook/storybook-deployer/bin/storybook_to_aws_s3:37:14)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
error Command failed with exit code 1.

I've checked that aws is installed and within the PATH of the runner:

which aws = /usr/local/bin/aws
echo $PATH = /home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Expected behavior

I expected the action to be able to find the AWS binary.

Has anyone been able to run this within a github action? I tried to run npm run (even though the package was setup with yarn) and it gave me some really shady errors as well.

Any help/guidance would be much appreciated :)

@fspaniol fspaniol added the bug label Jan 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant