Closed19

AWS Amplifyを利用してPR対象ブランチのStorybookとデプロイ後の動きをサクッと確認したい!

りょたりょた
version: 1
applications:
  - appRoot: src
    frontend:
      phases:
        preBuild:
          commands:
            - npm install
        build:
          commands:
            - npm run build
      artifacts:
        baseDirectory: "../.next"
        files:
          - "**/*"
      cache:
        paths:
          - node_modules/**/*
  - appRoot: .storybook
    frontend:
      phases:
        preBuild:
          commands:
            - npm install
        build:
          commands:
            - npm run build-storybook
      artifacts:
        baseDirectory: storybook-static
        files:
          - "**/*"
      cache:
        paths:
          - node_modules/**/*
      buildPath: /
りょたりょた

最終盤

version: 1
applications:
  - appRoot: .storybook
    frontend:
      phases:
        preBuild:
          commands:
            - npm install
        build:
          commands:
            - npm run build-storybook
      artifacts:
        baseDirectory: storybook-static
        files:
          - "**/*"
      cache:
        paths:
          - node_modules/**/*
      buildPath: /

りょたりょた

モノレポではないものにしてみる。

version: 1
frontend:
      phases:
        preBuild:
          commands:
            - npm install
        build:
          commands:
            - npm run build-storybook
      artifacts:
        baseDirectory: storybook-static
        files:
          - "**/*"
      cache:
        paths:
          - node_modules/**/*
      buildPath: /

りょたりょた

エラーが出る。。

!!! CustomerError: Can't find required-server-files.json in build output directory
りょたりょた

storybookのプレビューをやってみる

りょたりょた

すでに接続されている場合、githubに遷移後、何もせずともAmplifyに戻れば作業できるようになる・

このスクラップは5ヶ月前にクローズされました