From 63eca925361ccec35f109a31b0a2560e1a181927 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 13 Jul 2023 13:11:20 -0500 Subject: [PATCH] Change Node version used in Github workflows, add build-storybook step to website test (#12748) Context: The "Deploy Fleet website" workflow is currently failing because the `build-storybook` step requires Node v16. image Changes: - Changed the `deploy-fleet-website` and `test-website` workflows to use Node 16. - Updated the version of `actions/setup-node` to v3 to use node 16. - added the `--legacy-peer-deps` flag to the `npm install` in the build-storybook step - Added a step to build the storybook to the `test-website` workflow. - Updated the `test-website` workflow to run when the workflow file is changed. --- .github/workflows/deploy-fleet-website.yml | 6 +++--- .github/workflows/test-website.yml | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-fleet-website.yml b/.github/workflows/deploy-fleet-website.yml index 434971e9b6..e88d8ebd3f 100644 --- a/.github/workflows/deploy-fleet-website.yml +++ b/.github/workflows/deploy-fleet-website.yml @@ -31,7 +31,7 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2 @@ -47,7 +47,7 @@ jobs: # Set the Node.js version - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -59,7 +59,7 @@ jobs: go-version: 1.19 # Download top-level dependencies and build Storybook in the website's assets/ folder - - run: npm install && npm run build-storybook -- -o ./website/assets/storybook --loglevel verbose + - run: npm install --legacy-peer-deps && npm run build-storybook -- -o ./website/assets/storybook --loglevel verbose # Now start building! # > …but first, get a little crazy for a sec and delete the top-level package.json file diff --git a/.github/workflows/test-website.yml b/.github/workflows/test-website.yml index cf2470efdb..89e36b621a 100644 --- a/.github/workflows/test-website.yml +++ b/.github/workflows/test-website.yml @@ -8,6 +8,7 @@ on: - 'handbook/**' - 'schema/**' - 'articles/**' + - '.github/workflows/test-website.yml' # This allows a subsequently queued workflow run to interrupt previous runs concurrency: @@ -28,17 +29,21 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2 # Set the Node.js version - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + + # Download top-level dependencies and build Storybook in the website's assets/ folder. + - run: npm install --legacy-peer-deps && npm run build-storybook -- -o ./website/assets/storybook --loglevel verbose + # Now start building! # > …but first, get a little crazy for a sec and delete the top-level package.json file # > i.e. the one used by the Fleet server. This is because require() in node will go