From 645c4b3aad6dfe7e2cd25d01c425168851892d39 Mon Sep 17 00:00:00 2001 From: Joel Olawanle <57611810+olawanlejoel@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:03:54 +0100 Subject: [PATCH] Update react.js.yml --- .github/workflows/react.js.yml | 35 ++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/react.js.yml b/.github/workflows/react.js.yml index 90470aa..1a51afa 100644 --- a/.github/workflows/react.js.yml +++ b/.github/workflows/react.js.yml @@ -2,12 +2,13 @@ name: ChatGPT Clone App CI on: push: - branches: ["main"] + branches: "main" pull_request: - branches: ["main"] + branches: "main" jobs: eslint: + name: Check Syntax with ESLint runs-on: ubuntu-latest strategy: @@ -15,31 +16,45 @@ jobs: node-version: [18.x, 20.x] steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} to Check Lint uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' - - run: npm ci - - run: npm run lint + + - name: Install Dependencies + run: npm ci + + - name: Run ESLint + run: npm run lint - test: + tests: + name: Run Tests needs: eslint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + - name: Use Node.js 18.x to run Test uses: actions/setup-node@v3 with: node-version: 18.x cache: 'npm' - - run: npm ci - - run: npm run test + + - name: Install Dependencies + run: npm ci + + - name: Run Tests + run: npm run test deploy: - needs: [eslint, test] + name: Re-Deploy Application + needs: [eslint, tests] runs-on: ubuntu-latest steps: