name: Deploy Storybook

on:
  push:
    branches:
      - master

jobs:
  storybook:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v2.1.2
        with:
          node-version: 14.x

      - name: Install dependencies
        run: yarn install

      - name: Build Storybook
        run: yarn storybook:build

      - name: Deploy Storybook
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./packages/pancake-uikit/storybook-static
          publish_branch: gh-pages
          user_name: "github-actions"
          user_email: "github-actions@users.noreply.github.com"
