From 262d7b452540725eb9bf74c179a427d2a9e929ac Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 11:12:48 +0000 Subject: [PATCH 1/6] chore(ci): always build docs --- .github/workflows/docs-pr.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index a16487a49ef..cbf3944c722 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -47,12 +47,8 @@ jobs: }) } - build_and_deploy_preview: + build_preview: runs-on: ubuntu-latest - permissions: - pull-requests: write - needs: add_label - if: needs.add_label.outputs.has_label == 'true' steps: - name: Checkout code uses: actions/checkout@v4 @@ -78,6 +74,30 @@ jobs: run: yarn workspaces foreach -Rt run build + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: docs + path: ./docs/build/ + retention-days: 3 + + + deploy_preview: + needs: [build_preview, add_label] + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: needs.add_label.outputs.has_label == 'true' + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download built docs + uses: actions/download-artifact@v3 + with: + name: docs + path: ./docs/build + - name: Deploy to Netlify uses: nwtgck/actions-netlify@v2.1 with: From 8a7fecfd225e038ad49916d867d300e96ce1f418 Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 11:20:43 +0000 Subject: [PATCH 2/6] chore: only build docs dependencies --- .github/workflows/docs-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index cbf3944c722..b5b1ef29bc9 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -72,7 +72,7 @@ jobs: - name: Build docs run: - yarn workspaces foreach -Rt run build + yarn workspaces foreach -Rpt --from docs run build - name: Upload artifact uses: actions/upload-artifact@v3 From 99c4296f988c4067b4f39b74f2dedaad77eddd68 Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 11:57:13 +0000 Subject: [PATCH 3/6] chore: bump `github-script` version --- .github/workflows/docs-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index b5b1ef29bc9..f255a86d1fe 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Check if label is present id: check-labels - uses: actions/github-script@v3 + uses: actions/github-script@v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -33,7 +33,7 @@ jobs: - name: Add label if not present if: steps.check-labels.outputs.result == 'true' - uses: actions/github-script@v3 + uses: actions/github-script@v7.0.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | From 54fe074a08ccf8c2c39c7f8301b8256e4276ebeb Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 11:59:32 +0000 Subject: [PATCH 4/6] chore: update `setup-node` version --- .github/actions/setup/action.yml | 2 +- .github/workflows/docs-pr.yml | 9 ++------- .github/workflows/publish-docs.yml | 9 ++------- .github/workflows/release.yml | 5 ----- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 8e24b6738a9..b265a63d29a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ description: Installs the workspace's yarn dependencies and caches them runs: using: composite steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 id: node with: node-version: 18.17.1 diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index f255a86d1fe..6012a66727a 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -53,10 +53,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' + - name: Install Yarn dependencies + uses: ./.github/actions/setup - name: Install wasm-bindgen-cli uses: taiki-e/install-action@v2 @@ -67,9 +65,6 @@ jobs: run: | npm i wasm-opt -g - - name: Install Yarn dependencies - uses: ./.github/actions/setup - - name: Build docs run: yarn workspaces foreach -Rpt --from docs run build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 07b39d7627c..231b57550c9 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -15,10 +15,8 @@ jobs: - name: Checkout release branch uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' + - name: Install Yarn dependencies + uses: ./.github/actions/setup - name: Install wasm-bindgen-cli uses: taiki-e/install-action@v2 @@ -29,9 +27,6 @@ jobs: run: | npm i wasm-opt -g - - name: Install Yarn dependencies - uses: ./.github/actions/setup - - name: Build docs for deploying working-directory: docs run: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9f6fe2fc54..232a1d17ccb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,11 +68,6 @@ jobs: ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }} token: ${{ secrets.NOIR_RELEASES_TOKEN }} - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' - - name: Install Yarn dependencies uses: ./.github/actions/setup From 4a550ef0077da171d2c35bdf7472866f5aaace56 Mon Sep 17 00:00:00 2001 From: Tom French Date: Wed, 17 Jan 2024 12:05:43 +0000 Subject: [PATCH 5/6] chore: increase pagination for PR files --- .github/workflows/docs-pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index 6012a66727a..026c6e8b7cb 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -24,7 +24,8 @@ jobs: const { data: files } = await github.pulls.listFiles({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: context.issue.number + pull_number: context.issue.number, + per_page: 100 }); // Check if any file is within the 'docs' folder From e428555b468f4abd99249b16f957cfb10b8cdc41 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:26:30 +0000 Subject: [PATCH 6/6] Update docs-pr.yml --- .github/workflows/docs-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index 026c6e8b7cb..cf40b9357cd 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -21,7 +21,7 @@ jobs: } // Fetch the list of files changed in the PR - const { data: files } = await github.pulls.listFiles({ + const { data: files } = await github.rest.pulls.listFiles({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number,