nishimura.clubnishimura.club

StoryboookをGitHub Pagesにデプロイする

作成日
2022-11-16
更新日
2022-11-16

環境

  • NXを使用したmonorepoプロジェクト

コード

  • dist/storybook/client-componentにstorybookのビルド時成果物を置いている。
  • ./.github/actions/setupyarn installとか実行している。
  • libs/client/component/**libs/client/theme/**にmasterにマージ時に、変更があった場合に動く。
  • storybookのビルドとデプロイは分ける
  • gh-pagesブランチに.nojekylldist/storybook/client-componentが同ディレクトリに置かれる。何かうまくいかない時は確認する。
name: Deploy Storybook to GitHub Pages on: push: branches: - master paths: - 'libs/client/component/**' - 'libs/client/theme/**' env: GITHUB_PACKAGE_TOKEN: ${{ secrets.XXX }} jobs: setup: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup gh-pages: timeout-minutes: 10 name: deploy Storybook to GitHub Pages runs-on: ubuntu-22.04 needs: setup steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup - name: Build Storybook run: yarn nx run client-component:build-storybook - name: Deploy Storybook uses: JamesIves/github-pages-deploy-action@v4.4.1 with: branch: gh-pages folder: dist/storybook/client-component clean: true token: ${{ secrets.GITHUB_TOKEN }} commit-message: 'Deploy Storybook to GitHub Pages'

ドキュメント

  • : buildとdeployを分けて、実行するようなアクションではななさそうなので、やめた。オプションはあったが、うまく行かなかった
  • : gh-pagesブランチのディレクトリ構成がおかしくなっていたので、やめた(おそらく設定を間違えている)

Related

Tags

GitHub
Storybook

Share

Table of Contents

環境コードドキュメント