From 9cd59ef697d64119705408b4f6116e42ccc1b5de Mon Sep 17 00:00:00 2001 From: Kanika Pasrija <58769601+kanika1894@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:20:18 +0530 Subject: [PATCH 1/4] Create ci.yml --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e463051 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test From 91502ae4aa3524d2edf6ca798d7cb2d273ec0ed9 Mon Sep 17 00:00:00 2001 From: Kanika Pasrija <58769601+kanika1894@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:27:47 +0530 Subject: [PATCH 2/4] Update ci.yml --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e463051..2279470 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,13 +5,17 @@ name: Node.js CI on: push: - branches: [ main ] + branches: + - main + - releases/* pull_request: - branches: [ main ] + branches: + - main + - releases/* jobs: - build: - + build-test: + name: Build and test runs-on: ubuntu-latest strategy: From aa4caaebfe3349d5e6d6bf5dd06643f6786e2be7 Mon Sep 17 00:00:00 2001 From: Kanika Pasrija <58769601+kanika1894@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:28:57 +0530 Subject: [PATCH 3/4] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2279470..7fb5c1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: React App CI on: push: From 687b1ec59d9e67e603f1d835c4580a9b796b9297 Mon Sep 17 00:00:00 2001 From: Kanika Pasrija <58769601+kanika1894@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:35:54 +0530 Subject: [PATCH 4/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 819043a..c8295fc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![React App CI](https://github.com/kanika1894/ci-cd-with-actions/actions/workflows/ci.yml/badge.svg)](https://github.com/kanika1894/ci-cd-with-actions/actions/workflows/ci.yml)

CI/CD with GitHub Actions

@kmkumaran @kaverma