From b30519484140d349f1b8987fc4fb8c86ab5039e2 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Mon, 13 Nov 2023 00:12:37 +0100 Subject: [PATCH] ci: revert deploying vercel with ci for now --- .github/workflows/deploy-website.yml | 24 +++++++++---------- .github/workflows/documentation.yml | 23 ------------------ apps/website/vercel.json | 8 ------- .../actions/src/uploadSearchIndices/index.ts | 13 ++++++---- 4 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 apps/website/vercel.json diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 786a980ca..e0b2c2857 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -8,21 +8,19 @@ jobs: deploy-website: name: Deploy website runs-on: ubuntu-latest - permissions: - contents: read - deployments: write + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} if: github.repository_owner == 'discordjs' steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Build & deploy website - uses: BetaHuhn/deploy-to-vercel-action@643bc80032ba62ca41d1a9aaba7b38b51c2b8646 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - VERCEL_SCOPE: 'discordjs' - GITHUB_DEPLOYMENT_ENV: 'Production – discord-js' - PRODUCTION: true + - name: Pull vercel production environment + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + + - name: Build website artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy website artifacts to vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4ee59eeea..f21972e13 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -149,26 +149,3 @@ jobs: SEARCH_API_URL: ${{ secrets.SEARCH_API_URL }} SEARCH_API_KEY: ${{ secrets.SEARCH_API_KEY }} uses: ./packages/actions/src/uploadSearchIndices - - deploy-website: - needs: build-docs - name: Deploy website - runs-on: ubuntu-latest - permissions: - contents: read - deployments: write - if: github.repository_owner == 'discordjs' - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Build & deploy website - uses: BetaHuhn/deploy-to-vercel-action@643bc80032ba62ca41d1a9aaba7b38b51c2b8646 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - VERCEL_SCOPE: 'discordjs' - GITHUB_DEPLOYMENT_ENV: 'Production – discord-js' - PRODUCTION: true diff --git a/apps/website/vercel.json b/apps/website/vercel.json deleted file mode 100644 index af292d4ca..000000000 --- a/apps/website/vercel.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://openapi.vercel.sh/vercel.json", - "git": { - "deploymentEnabled": { - "main": false - } - } -} diff --git a/packages/actions/src/uploadSearchIndices/index.ts b/packages/actions/src/uploadSearchIndices/index.ts index d886d7d34..9755196a1 100644 --- a/packages/actions/src/uploadSearchIndices/index.ts +++ b/packages/actions/src/uploadSearchIndices/index.ts @@ -52,10 +52,15 @@ try { console.log('Generated all indices.'); console.log('Uploading indices...'); - for (const index of indices) { - console.log(`Uploading ${index.index}...`); - await client.index(index.index).addDocuments(index.data); - } + + try { + await Promise.all( + indices.map(async (index) => { + console.log(`Uploading ${index.index}...`); + return client.index(index.index).addDocuments(index.data); + }), + ); + } catch {} console.log('Uploaded all indices.'); } catch (error) {