diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index d972ae7c90..22fc24df23 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -3,11 +3,6 @@ name: Frontend CI on: pull_request: types: [opened, reopened, edited, synchronize] - push: - branches: - - master - paths: - - 'packages/core/src/**' jobs: build: @@ -47,23 +42,5 @@ jobs: - run: yarn lint - run: yarn build - run: yarn test - - deploy-storybook: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x] - steps: - - uses: actions/checkout@v2 - - name: build storybook - run: | - yarn install - yarn workspace storybook build-storybook - - name: deploy gh-pages - uses: JamesIves/github-pages-deploy-action@3.4.2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages - FOLDER: packages/storybook/dist + - name: verify storybook + run: yarn workspace storybook build-storybook diff --git a/.github/workflows/storybook-deploy.yml b/.github/workflows/storybook-deploy.yml new file mode 100644 index 0000000000..9a266144bc --- /dev/null +++ b/.github/workflows/storybook-deploy.yml @@ -0,0 +1,50 @@ +name: Deploy Storybook + +on: + push: + branches: + - master + paths: + - '.github/workflows/storybook-deploy.yml' + - 'packages/storybook/**' + - 'packages/core/src/**' + +jobs: + deploy-storybook: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: find location of global yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: cache global yarn cache + uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} + + - name: use node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://registry.npmjs.org/ # Needed for auth + - run: yarn install + - name: build storybook + run: yarn workspace storybook build-storybook + - name: deploy storybook to gh-pages + uses: JamesIves/github-pages-deploy-action@3.4.2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: packages/storybook/dist