Skip to content

Commit f602a27

Browse files
GitHub workflow cleanup and alignment with Docusaurus 3.8 (#5420)
* GitHub workflow cleanup and alignment with Docusaurus 3.8 * Potential fix for code scanning alert no. 7: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * cleanup * Update .github/workflows/pr.yml * add pull-requests: read --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent e745718 commit f602a27

File tree

4 files changed

+50
-36
lines changed

4 files changed

+50
-36
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build and Deploy
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -13,7 +16,7 @@ on:
1316
default: "/"
1417
type: string
1518
environment:
16-
description: GHA environment name
19+
description: GitHub Actions environment name (used for scoping secrets and deployment)
1720
required: true
1821
type: string
1922
secrets:
@@ -35,6 +38,7 @@ jobs:
3538
env:
3639
CI: true
3740
NODE_ENV: production
41+
NODE_OPTIONS: "--max-old-space-size=8192 --max-http-header-size=8192"
3842
AWS_PAGER: ""
3943
HOSTNAME: ${{ inputs.hostname }}
4044
BASE_URL: ${{ inputs.base_url }}
@@ -53,16 +57,14 @@ jobs:
5357
uses: actions/cache@v3
5458
with:
5559
path: node_modules/.cache
56-
key: ${{ runner.os }}-webpack-cache
60+
key: ${{ runner.os }}-webpack-cache-${{ hashFiles('yarn.lock') }}
5761
- name: Install awscli
5862
uses: unfor19/install-aws-cli-action@v1
5963
- name: Install jq
6064
run: sudo apt-get install -y jq
6165
- name: Install dependencies
6266
run: yarn install --frozen-lockfile
6367
- name: Build the Docusaurus site
64-
env:
65-
NODE_OPTIONS: "--max-old-space-size=8192 --max-http-header-size=8192"
6668
run: yarn build
6769
- name: Deploy the Docusaurus site
6870
env:

.github/workflows/delete-review.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: delete-review
22

3+
permissions:
4+
contents: read
5+
36
on: delete
47

58
jobs:
@@ -9,6 +12,7 @@ jobs:
912
name: review/${{ github.ref_name }}
1013
env:
1114
CI: true
15+
NODE_OPTIONS: "--max-old-space-size=8192 --max-http-header-size=8192"
1216
AWS_PAGER: ""
1317
BASE_URL: /${{ github.ref_name }}/
1418
AWS_DEFAULT_REGION: us-east-1
@@ -23,6 +27,7 @@ jobs:
2327
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2428
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2529
run: |
30+
echo "Removing files at s3://${S3_BUCKET_NAME}${BASE_URL}"
2631
aws s3 rm --recursive s3://${S3_BUCKET_NAME}${BASE_URL}
2732
export INVALIDATION_ID=$(
2833
aws cloudfront create-invalidation \

.github/workflows/pr.yml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
name: Pull Request Checks
22

3+
permissions:
4+
contents: read
5+
pull-requests: read
6+
37
on:
4-
pull_request:
5-
branches:
6-
- main
7-
merge_group:
8-
types:
9-
- checks_requested
8+
pull_request:
9+
branches:
10+
- main
11+
merge_group:
12+
types:
13+
- checks_requested
14+
15+
env:
16+
CI: true
17+
NODE_ENV: production
18+
NODE_OPTIONS: "--max-old-space-size=8192 --max-http-header-size=8192"
1019

1120
jobs:
12-
build-and-deploy:
13-
runs-on: ubuntu-latest
14-
env:
15-
CI: true
16-
NODE_ENV: production
17-
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up Node.js
20-
uses: actions/setup-node@v3
21-
with:
22-
node-version: '20.x'
23-
cache: 'yarn'
24-
- name: Docusaurus Webpack cache
25-
uses: actions/cache@v3
26-
with:
27-
path: node_modules/.cache
28-
key: ${{ runner.os }}-webpack-cache
29-
- name: Install dependencies
30-
run: yarn install --frozen-lockfile
31-
- name: Build the Docusaurus site
32-
env:
33-
NODE_OPTIONS: "--max-old-space-size=8192 --max-http-header-size=8192"
34-
run: yarn build
35-
spellcheck:
36-
runs-on: ubuntu-latest
37-
steps:
21+
build-and-deploy:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20.x'
29+
cache: 'yarn'
30+
- name: Docusaurus Webpack cache
31+
uses: actions/cache@v3
32+
with:
33+
path: node_modules/.cache
34+
key: ${{ runner.os }}-webpack-cache-${{ hashFiles('yarn.lock') }}
35+
- name: Install dependencies
36+
run: yarn install --frozen-lockfile
37+
- name: Build the Docusaurus site
38+
run: yarn build
39+
spellcheck:
40+
runs-on: ubuntu-latest
41+
steps:
3842
- uses: actions/checkout@v4
3943
- uses: codespell-project/actions-codespell@master
4044
name: Check spelling

.github/workflows/production.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: deploy-to-production
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches:

0 commit comments

Comments
 (0)