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.
<img width="1013" alt="image"
src="https://github.com/fleetdm/fleet/assets/7445991/7681e11e-a94f-4a0b-8cd8-baa1ef5a37d8">

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.
This commit is contained in:
Eric 2023-07-13 13:11:20 -05:00 committed by GitHub
parent 125590f345
commit 63eca92536
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -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

View file

@ -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