From 13714825fef191280e0395233afb4f9e3f9ff9b1 Mon Sep 17 00:00:00 2001 From: georgewrmarshall Date: Wed, 31 Jan 2024 16:49:22 -0800 Subject: [PATCH] attempting to update build and deploy storybook workflow with new actions --- .github/workflows/build-deploy-storybook.yml | 34 +++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-deploy-storybook.yml b/.github/workflows/build-deploy-storybook.yml index e37bd0b9..9a0aaf8a 100644 --- a/.github/workflows/build-deploy-storybook.yml +++ b/.github/workflows/build-deploy-storybook.yml @@ -10,22 +10,24 @@ jobs: permissions: contents: write runs-on: ubuntu-latest + environment: github-pages steps: - - uses: actions/checkout@v2 + - name: Checkout the repository + uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 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 + node-version-file: '.nvmrc' + cache: 'yarn' + - name: Install npm dependencies + run: yarn --immutable + - name: Run build script + run: yarn build:storybook + - name: Deploy to `storybook-static` directory of `gh-pages` branch + uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935 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 }} + # This `PUBLISH_DOCS_TOKEN` needs to be manually set per-repository. + # Look in the repository settings under "Environments", and set this token in the `github-pages` environment. + personal_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./storybook-static + destination_dir: storybook-static