Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

ci: fix storybook deployment failure (#516)

白熱e0e73c14fc71
diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml
index 5ecfccc92a..805dd002d3 100644
--- a/.github/workflows/ci-test.yml
+++ b/.github/workflows/ci-test.yml
@@ -56,6 +56,7 @@ jobs:
- name: 🩺 Run test
run: pnpm run coverage
+ # TODO: cross fork PR will not trigger this action
- name: 🧬 Report coverage
uses: codecov/codecov-action@v3
env:
diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml
index e8c0114636..6fe01cd91a 100644
--- a/.github/workflows/preview-build.yml
+++ b/.github/workflows/preview-build.yml
@@ -1,10 +1,8 @@
name: 📦 Preview Build
on:
- push:
- branches: [main, dev]
pull_request:
- branches: [main, dev]
+ branches: [dev]
permissions:
contents: read
@@ -52,6 +50,7 @@ jobs:
- name: 📦 Build
run: pnpm run build
+ # build demo
- name: 📦 Build demo
run: pnpm run build:demo
@@ -70,6 +69,18 @@ jobs:
restore-keys: |
${{ runner.os }}-demo-
+ # build storybook
+ - name: 📦 Build storybook
+ run: pnpm run build:storybook
+
+ - name: Setup storybook cache
+ uses: actions/cache@v3
+ with:
+ path: storybook-static
+ key: ${{ runner.os }}-storybook-${{ github.event.pull_request.number }}
+ restore-keys: |
+ ${{ runner.os }}-storybook-
+
set-pr-id:
name: Set PR ID
runs-on: ubuntu-latest
diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml
index 657b75b0c9..ddc1abee7e 100644
--- a/.github/workflows/preview-deploy.yml
+++ b/.github/workflows/preview-deploy.yml
@@ -29,12 +29,10 @@ jobs:
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
- name: Checkout
- if: ${{ steps.pr.outputs.id != '' }}
uses: actions/checkout@v3
- - name: Setup workspace cache
+ - name: Setup demo cache
uses: actions/cache@v3
- if: ${{ steps.pr.outputs.id != '' }}
with:
path: .workspace
key: ${{ runner.os }}-demo-${{ steps.pr.outputs.id }}
@@ -43,16 +41,22 @@ jobs:
- name: 🚀 Deploy to Vercel (demo)
uses: amondnet/vercel-action@v25
- if: ${{ steps.pr.outputs.id != '' }}
id: vercel-demo
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: ${{ secrets.PROJECT_ID}}
+ - name: Setup storybook cache
+ uses: actions/cache@v3
+ with:
+ path: storybook-static
+ key: ${{ runner.os }}-storybook-${{ steps.pr.outputs.id }}
+ restore-keys: |
+ ${{ runner.os }}-storybook-
+
- name: 🚀 Deploy to Vercel (storybook)
uses: amondnet/vercel-action@v25
- if: ${{ steps.pr.outputs.id != '' }}
id: vercel-storybook
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
@@ -61,7 +65,7 @@ jobs:
- name: 👾 Discord Notification
uses: sarisia/actions-status-discord@v1
- if: ${{ steps.pr.outputs.id != '' && success() }}
+ if: ${{ success() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
@@ -81,7 +85,7 @@ jobs:
- name: 👾 Discord Notification
uses: sarisia/actions-status-discord@v1
- if: ${{ steps.pr.outputs.id != '' && failure() }}
+ if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ job.status }}
@@ -96,7 +100,6 @@ jobs:
- name: 🧽 Find And Delete Comment
uses: peter-evans/find-comment@v2
- if: ${{ steps.pr.outputs.id != '' }}
id: fc
with:
issue-number: ${{ steps.pr.outputs.id }}
@@ -105,7 +108,6 @@ jobs:
- name: 📝 Create or update comment
uses: peter-evans/create-or-update-comment@v3
- if: ${{ steps.pr.outputs.id != '' }}
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ steps.pr.outputs.id }}