From f49b7db41458583a74a84f4433e2d685ab1855f9 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Thu, 28 Dec 2023 23:33:09 +0530 Subject: [PATCH] chore: add workflow for CI and deployment of web --- .github/workflows/web.yaml | 51 ++++++++++++++++++++++++++++++++++++++ apps/web/next.config.js | 6 ----- 2 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/web.yaml diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml new file mode 100644 index 00000000..0b3f57ba --- /dev/null +++ b/.github/workflows/web.yaml @@ -0,0 +1,51 @@ +on: + push: + branches: [main] + paths: ['apps/web/**'] + pull_request: + paths: ['apps/web/**'] + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:web + + - name: Test + run: | + pnpm run test:web + + deploy: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + name: Lint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install packages + run: | + pnpm i + + - name: Build + run: | + pnpm run build:web + + - name: Deploy + run: | + pnpm install --global vercel + vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 50bba982..d7197c59 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -1,7 +1,6 @@ //@ts-check // eslint-disable-next-line @typescript-eslint/no-var-requires -const { composePlugins, withNx } = require('@nx/next') const path = require('path') /** @type {import('next').NextConfig} */ @@ -21,8 +20,3 @@ const nextConfig = { } module.exports = nextConfig - -const plugins = [ - // Add more Next.js plugins to this list if needed. - withNx -]