Merge pull request #4119 from amitsingh-007/feat-web-turbopack-build #428
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy CI | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-latest | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| outputs: | |
| preview_url: ${{ steps.vercel-action.outputs.preview-url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setting up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Pull environment variables | |
| run: pnpm vercel env pull .env --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy Preview (Vercel) | |
| uses: amondnet/vercel-action@v42 | |
| id: vercel-action | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
| github-comment: false | |
| - name: Building Extension | |
| run: pnpm build --filter=@bypass/extension | |
| - name: Uploading extensions | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: extensions-folder | |
| path: ./apps/extension/.output | |
| include-hidden-files: true | |
| - name: Point extension at the preview deployment | |
| run: sed -i "s#^NEXT_PUBLIC_HOST_NAME=.*#NEXT_PUBLIC_HOST_NAME=${{ steps.vercel-action.outputs.preview-url }}#" .env | |
| - name: Building extension for e2e | |
| run: pnpm build --filter=@bypass/extension | |
| - name: Uploading e2e extension | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: chrome-extension-folder | |
| path: ./apps/extension/.output/chrome-mv3 | |
| Playwright: | |
| needs: [Build] | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setting up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Cache Playwright binaries | |
| uses: actions/cache@v6 | |
| id: playwright-cache | |
| with: | |
| path: | | |
| ~/Library/Caches/ms-playwright | |
| ~/.cache/ms-playwright | |
| ${{ github.workspace }}/node_modules/playwright | |
| key: cache-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: cache-playwright- | |
| - name: Download extension | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: chrome-extension-folder | |
| path: ./apps/extension/.output/chrome-mv3/ | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Pull environment variables | |
| run: pnpm vercel env pull .env --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Install Playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: pnpm playwright install --with-deps | |
| - name: Run Playwright tests | |
| run: pnpm e2e | |
| env: | |
| PLAYWRIGHT_TEST_BASE_URL: ${{ needs.Build.outputs.preview_url }} | |
| - name: Upload Playwright test report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: .playwright/playwright-report/ | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| needs: [Playwright] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setting up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Start deployment | |
| uses: bobheadxi/deployments@v1.5.0 | |
| id: deployment | |
| with: | |
| step: start | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| env: Production | |
| - name: Deploy (Vercel) | |
| uses: amondnet/vercel-action@v42 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
| vercel-args: '--prod' | |
| - name: Finish deployment | |
| uses: bobheadxi/deployments@v1.5.0 | |
| if: always() | |
| with: | |
| step: finish | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| status: ${{ job.status }} | |
| deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
| env_url: ${{ steps.vercel-action.outputs.preview-url }} | |
| env: ${{ steps.deployment.outputs.env }} | |
| - name: Download extensions | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: extensions-folder | |
| path: ./apps/extension/.output | |
| - name: Uploading extensions | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: packaged-extensions | |
| path: ./apps/extension/.output | |
| include-hidden-files: true | |
| Create_Release: | |
| runs-on: ubuntu-latest | |
| needs: [Deploy] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Download packaged extensions | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: packaged-extensions | |
| path: ./apps/extension/.output | |
| - name: Generate Release Tag | |
| id: release_tag | |
| uses: amitsingh-007/next-release-tag@v6.6.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_prefix: 'v' | |
| tag_template: 'yy.mm.i' | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| name: Release ${{ steps.release_tag.outputs.next_release_tag }} | |
| tag_name: ${{ steps.release_tag.outputs.next_release_tag }} | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| generate_release_notes: true | |
| files: | | |
| ./apps/extension/.output/chrome-*.zip |