diff --git a/.github/workflows/build-deploy-storybook.yml b/.github/workflows/build-deploy-storybook.yml new file mode 100644 index 00000000..43c0da06 --- /dev/null +++ b/.github/workflows/build-deploy-storybook.yml @@ -0,0 +1,32 @@ +name: Build and Deploy Storybook + +on: + push: + branches: [main] + pull_request: + +jobs: + publish-release: + permissions: + contents: write + if: github.event.pull_request.merged + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + # We check out the pull request's base branch, which will be + # used as the base branch for all git operations. + ref: ${{ github.event.pull_request.base.ref }} + - name: Get Node.js version + id: nvm + run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) + - uses: actions/setup-node@v2 + with: + node-version: ${{ steps.nvm.outputs.NODE_VERSION }} + - run: yarn + - uses: MetaMask/action-publish-gh-pages@v2 + with: + build-command: build-storybook + source-directory: storybook-static + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.nvmrc b/.nvmrc index dae199ae..6f7f377b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12 +v16