From 2098e6b9f9d327b3584804a782f5e48993e73749 Mon Sep 17 00:00:00 2001 From: Prajjwal Yadav Date: Thu, 11 Jan 2024 23:02:49 +0530 Subject: [PATCH] added testing and linting in the cicd --- .github/workflows/main.yml | 49 ------------------------------------ .github/workflows/vercel.yml | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index a18dcd4..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Deployment - -on: - push: - branches: - - main - pull_request: - branches: [main] - types: [opened, synchronize] - -jobs: - Test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install dependencies - run: npm install - - - name: lint - run: npm run lint - - - name: test - run: npm run test - - Deploy-Production: - needs: [Test] - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install Vercel CLI - run: npm install --global vercel@latest - - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - - name: Build Project Artifacts - run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml index 727b98b..f7e76aa 100644 --- a/.github/workflows/vercel.yml +++ b/.github/workflows/vercel.yml @@ -2,12 +2,38 @@ name: Vercel Production Deployment env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + on: push: branches: - main + pull_request: + branches: [main] + types: [opened, synchronize] + jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: lint + run: npm run lint + + - name: test + run: npm run test + Deploy-Production: + needs: [Test] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2