From 925f1deee98720a4acc85e2dcb84e9682dc45131 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 26 May 2024 11:28:32 +0800 Subject: [PATCH 1/4] ci(deploy): Add docs deploy CI --- .github/workflows/deploy-docs.yml | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..013dff6 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,54 @@ +name: Deploy Documentation + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + vercel: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Cache Dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node- + + - name: Setup node + uses: actions/setup-node@v4.0.2 + with: + cache: npm + + - name: Build + run: | + yarn install --frozen-lockfile + npm run build + + - name: Run Tests Locally + run: npm run test + + - name: Deploy to Staging + id: deploy-vercel-staging + uses: amondnet/vercel-action@v25 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TL_ENGINE }} + scope: ${{ secrets.VERCEL_ORG_ID }} + + - name: Deploy to Production + uses: amondnet/vercel-action@v25 + id: deploy-vercel-production + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TL_ENGINE }} + vercel-args: "--prod" + scope: ${{ secrets.VERCEL_ORG_ID }} From 4f0b6af8b700dc27cf3aad608b595d46dc7500b3 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 26 May 2024 11:30:16 +0800 Subject: [PATCH 2/4] ci(deploy): Only test docs --- .github/workflows/deploy-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 013dff6..6759a77 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -31,7 +31,7 @@ jobs: npm run build - name: Run Tests Locally - run: npm run test + run: npm run test:docs - name: Deploy to Staging id: deploy-vercel-staging From da06af6f28ecc46f5a3d7c5b53f3ce43f24e23e1 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 26 May 2024 11:32:44 +0800 Subject: [PATCH 3/4] ci(deploy): Fix secret name --- .github/workflows/deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 6759a77..c675889 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -39,7 +39,7 @@ jobs: with: vercel-token: ${{ secrets.VERCEL_TOKEN }} vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} - vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TL_ENGINE }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} scope: ${{ secrets.VERCEL_ORG_ID }} - name: Deploy to Production @@ -49,6 +49,6 @@ jobs: with: vercel-token: ${{ secrets.VERCEL_TOKEN }} vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} - vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_TL_ENGINE }} + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} vercel-args: "--prod" scope: ${{ secrets.VERCEL_ORG_ID }} From 5e3d75b178ab8112e457029fb3d1fc9d9d912449 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sun, 26 May 2024 11:50:16 +0800 Subject: [PATCH 4/4] docs: Fix weird rendering behavior --- docs/src/pages/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/pages/index.mdx b/docs/src/pages/index.mdx index 11f857b..0933245 100644 --- a/docs/src/pages/index.mdx +++ b/docs/src/pages/index.mdx @@ -69,9 +69,9 @@ export function Feature({ >

- Thread + Thread - - v2.0.2 +  - v2.0.2