Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 35 additions & 26 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,57 @@
name: Preview Documentation

on:
pull_request:
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
2 changes: 2 additions & 0 deletions website/docs/quickstart/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ title: 'Simple example'

### Read the spreadsheet

Just change for preview! Trigger the Build.

Below is an example of reading a spreadsheet document:

```java
Expand Down
Loading