From 6d03a8f0f5c2d9d9be17af83774efd5bcf06d34c Mon Sep 17 00:00:00 2001 From: progaws86 Date: Sun, 9 Nov 2025 18:04:18 +0500 Subject: [PATCH 01/12] Delete .github/workflows directory --- .github/workflows/deploy.yml | 18 ----------- .github/workflows/integration.yml | 51 ------------------------------- 2 files changed, 69 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 35fe7716..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,18 +0,0 @@ - -name: Deploy - -on: - push: - branches: [ "main" ] - -jobs: - deploy: - - runs-on: ubuntu-latest - - - steps: - - uses: actions/checkout@v4 - - run: docker build . -t harishneel/next-js-app - - run: echo "${{secrets.DOCKERHUB_PASSWORD}}" | docker login -u ${{secrets.DOCKERHUB_USERNAME}} --password-stdin - - run: docker push harishneel/next-js-app:latest \ No newline at end of file diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 8a2fa081..00000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,51 +0,0 @@ - -name: Integration - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: "Installing Dependencies" - run: npm i - - - name: "Build command" - run: npm run build - - unit-tests: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: "Installing Dependencies" - run: npm i - - - name: "Running test cases" - run: npm run test \ No newline at end of file From 6889074554ae288c201a7361b6d28ce763758ae9 Mon Sep 17 00:00:00 2001 From: progaws86 Date: Tue, 11 Nov 2025 12:59:04 +0500 Subject: [PATCH 02/12] Create node.js.yml --- .github/workflows/node.js.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..2284b935 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test From 30c8fe8d581cd71a0bad2740d15fef466608ff2e Mon Sep 17 00:00:00 2001 From: progaws86 Date: Tue, 11 Nov 2025 15:30:55 +0500 Subject: [PATCH 03/12] Delete .github/workflows directory --- .github/workflows/node.js.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 2284b935..00000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Node.js CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build --if-present - - run: npm test From 948b2bfa319a5de2a4246ffdb17f4f92846f593d Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 15:33:02 +0500 Subject: [PATCH 04/12] written workflow for integration --- .github/workflows/integration.yml | 51 +++++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 31 ------------------- package-lock.json | 2 +- 3 files changed, 52 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000..6f8d7a06 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,51 @@ + +name: Integration + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: " installing dependecies" + run: npm i --force + - name: "build command" + run: npm run build + + unite-test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: " installing dependecies" + run: npm i --force + - name: "Runing test cases" + run: npm run test \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 2284b935..00000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Node.js CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build --if-present - - run: npm test diff --git a/package-lock.json b/package-lock.json index 0a8df2ff..4501f46c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "with-jest-app", + "name": "next-js-app", "lockfileVersion": 3, "requires": true, "packages": { From 4cd22caae7e5d83575e2b7b1b24582f2f3503585 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 15:41:42 +0500 Subject: [PATCH 05/12] only one node --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 6f8d7a06..a0a737c9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From febd9727c8f53bc2b81cd3b390359b106cb52727 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 15:52:44 +0500 Subject: [PATCH 06/12] failing a tst case --- app/counter.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/counter.test.tsx b/app/counter.test.tsx index 8488296a..2d3b111c 100644 --- a/app/counter.test.tsx +++ b/app/counter.test.tsx @@ -8,5 +8,5 @@ it("App Router: Works with Client Components (React State)", () => { render(); expect(screen.getByRole("heading")).toHaveTextContent("0"); fireEvent.click(screen.getByRole("button")); - expect(screen.getByRole("heading")).toHaveTextContent("1"); + expect(screen.getByRole("heading")).toHaveTextContent("11"); }); From 1de9bad0fee71d55abd8f03e72ec58acd026ac8c Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 16:03:05 +0500 Subject: [PATCH 07/12] test cases are correct --- app/counter.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/counter.test.tsx b/app/counter.test.tsx index 2d3b111c..8488296a 100644 --- a/app/counter.test.tsx +++ b/app/counter.test.tsx @@ -8,5 +8,5 @@ it("App Router: Works with Client Components (React State)", () => { render(); expect(screen.getByRole("heading")).toHaveTextContent("0"); fireEvent.click(screen.getByRole("button")); - expect(screen.getByRole("heading")).toHaveTextContent("11"); + expect(screen.getByRole("heading")).toHaveTextContent("1"); }); From 7adf81d0749a8c36db8821887046585548eb3d82 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 16:51:28 +0500 Subject: [PATCH 08/12] resolve the test cases --- app/counter.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/counter.test.tsx b/app/counter.test.tsx index 2d3b111c..8488296a 100644 --- a/app/counter.test.tsx +++ b/app/counter.test.tsx @@ -8,5 +8,5 @@ it("App Router: Works with Client Components (React State)", () => { render(); expect(screen.getByRole("heading")).toHaveTextContent("0"); fireEvent.click(screen.getByRole("button")); - expect(screen.getByRole("heading")).toHaveTextContent("11"); + expect(screen.getByRole("heading")).toHaveTextContent("1"); }); From cb007c332f798b9b6edb7e264e263df0d28f32e6 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 16:54:27 +0500 Subject: [PATCH 09/12] more nodes version are added --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a0a737c9..3ef13f60 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [22.x] + node-version: [18.x,20.x,22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 1b9e247d22a571caa846d5de816c815445b4bc82 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 17:19:44 +0500 Subject: [PATCH 10/12] new deploy pipeline --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..9ed9a7d6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ + +name: Deploy + +on: + push: + branches: [ "main" ] + + +jobs: + deploy: + + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + - name: "create a docker image" + run: docker build -t githubactions12/next-js-app . + - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + - name: "push the image" + run: docker push githubactions12/next-js-app:latest + From d1a51240442d37ff314a975e6f0c0e36d614e013 Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 17:36:59 +0500 Subject: [PATCH 11/12] new version of software added --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9ed9a7d6..0ea4a6eb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,5 +18,5 @@ jobs: run: docker build -t githubactions12/next-js-app . - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: "push the image" - run: docker push githubactions12/next-js-app:latest + run: docker push githubactions12/next-js-app:v1 From b88455145b0d6219cd1f8d5d1d99b277cb631adc Mon Sep 17 00:00:00 2001 From: arifanadeem Date: Tue, 11 Nov 2025 17:39:50 +0500 Subject: [PATCH 12/12] error resolved in docker version --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0ea4a6eb..a89f8f97 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: "create a docker image" - run: docker build -t githubactions12/next-js-app . + run: docker build -t githubactions12/next-js-app:v1 . - run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: "push the image" run: docker push githubactions12/next-js-app:v1