From fcf699d813e11c29bf2437ec117ab6f5a97812f2 Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sun, 23 Nov 2025 13:47:43 +0800 Subject: [PATCH 1/5] docs: update example.md to clarify preview instructions --- website/docs/quickstart/example.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/quickstart/example.md b/website/docs/quickstart/example.md index 171ef7640..ad254aa54 100644 --- a/website/docs/quickstart/example.md +++ b/website/docs/quickstart/example.md @@ -7,6 +7,8 @@ title: 'Simple example' ### Read the spreadsheet +Just change for preview + Below is an example of reading a spreadsheet document: ```java From 2ff8ec86614d2c2c292187378e03f02804cf9a16 Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sun, 23 Nov 2025 13:52:42 +0800 Subject: [PATCH 2/5] docs: update example.md to clarify preview instructions --- .github/workflows/preview-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 3c74a0932..603a3829a 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -18,7 +18,7 @@ name: Preview Documentation on: - pull_request: + pull_request_target: paths: - 'website/**' From 318cae557ae6f62d34110b068cda41108e50a6a1 Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sun, 23 Nov 2025 13:54:40 +0800 Subject: [PATCH 3/5] docs: update example.md to clarify preview instructions --- website/docs/quickstart/example.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/quickstart/example.md b/website/docs/quickstart/example.md index ad254aa54..4c20152e0 100644 --- a/website/docs/quickstart/example.md +++ b/website/docs/quickstart/example.md @@ -7,7 +7,7 @@ title: 'Simple example' ### Read the spreadsheet -Just change for preview +Just change for preview! Below is an example of reading a spreadsheet document: From b7b20cbd915698c08bb1308732d089284affcaa2 Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sun, 23 Nov 2025 23:29:55 +0800 Subject: [PATCH 4/5] docs: update example.md to clarify preview instructions --- website/docs/quickstart/example.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/quickstart/example.md b/website/docs/quickstart/example.md index 4c20152e0..bc554e5ab 100644 --- a/website/docs/quickstart/example.md +++ b/website/docs/quickstart/example.md @@ -7,7 +7,7 @@ title: 'Simple example' ### Read the spreadsheet -Just change for preview! +Just change for preview! Trigger the Build. Below is an example of reading a spreadsheet document: From 8c1c2c4a878aa8ddb5d6c3b868cd79c6bf16857d Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sun, 23 Nov 2025 23:32:12 +0800 Subject: [PATCH 5/5] ci: update preview workflow to trigger on successful documentation builds --- .github/workflows/preview-docs.yml | 61 +++++++++++++++++------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 603a3829a..f52e7644d 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -18,48 +18,57 @@ name: Preview Documentation on: - pull_request_target: - paths: - - 'website/**' + workflow_run: + workflows: ["Build Documentation"] + types: + - completed jobs: - deploy-preview: + preview: runs-on: ubuntu-latest + permissions: + pull-requests: write + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - name: Download artifact + uses: actions/github-script@v7 with: - version: 8 - run_install: false + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{ github.event.workflow_run.id }}, + }); + const websiteArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == 'website' + })[0]; + var download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: websiteArtifact.id, + archive_format: 'zip', + }); + const fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/website.zip', Buffer.from(download.data)); - - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Corepack - working-directory: website - run: npm i -g --force corepack && corepack enable - - - name: Install Dependencies - working-directory: website - run: pnpm install - - - name: Build - working-directory: website - run: pnpm build + - name: Unzip artifact + run: unzip -q website.zip -d website/build - - name: Deploy to Netlify + - name: Deploy preview to Netlify uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 with: publish-dir: './website/build' production-deploy: false github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: ${{ github.event.pull_request.title }} + deploy-message: "Deploy preview for PR #${{ github.event.workflow_run.pull_requests[0].number }}" enable-pull-request-comment: true enable-commit-comment: false enable-github-deployment: false - alias: deploy-preview-${{ github.event.number }} + alias: deploy-preview-${{ github.event.workflow_run.pull_requests[0].number }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 10 \ No newline at end of file