From c03221019d02fda1c64c97e2d0f39aad339726ff Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Sun, 9 Feb 2025 04:10:53 +0530 Subject: [PATCH 1/9] updated Workflow --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8b64f0e..b3f58fe1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,7 @@ on: jobs: build: + name: build the project runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 960ad32150bfea35e9a31c0b28ddabbf520c4f36 Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:54:12 +0530 Subject: [PATCH 2/9] added spaces --- apps/bank-webhook/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/bank-webhook/src/index.ts b/apps/bank-webhook/src/index.ts index bb92555d..5cc88647 100644 --- a/apps/bank-webhook/src/index.ts +++ b/apps/bank-webhook/src/index.ts @@ -2,6 +2,8 @@ import express from "express"; import db from "@repo/db/client"; const app = express(); + + app.use(express.json()) app.post("/hdfcWebhook", async (req, res) => { From 6bf9b630c5a1d4a1e03b416b31f286fccee29512 Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 12:26:44 +0530 Subject: [PATCH 3/9] removed spaces --- apps/bank-webhook/src/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/bank-webhook/src/index.ts b/apps/bank-webhook/src/index.ts index 5cc88647..bb92555d 100644 --- a/apps/bank-webhook/src/index.ts +++ b/apps/bank-webhook/src/index.ts @@ -2,8 +2,6 @@ import express from "express"; import db from "@repo/db/client"; const app = express(); - - app.use(express.json()) app.post("/hdfcWebhook", async (req, res) => { From 3657f54e3abbaf7b40113dbfb54128bff7eb0ef9 Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 12:30:54 +0530 Subject: [PATCH 4/9] . --- apps/bank-webhook/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/bank-webhook/src/index.ts b/apps/bank-webhook/src/index.ts index bb92555d..111b630b 100644 --- a/apps/bank-webhook/src/index.ts +++ b/apps/bank-webhook/src/index.ts @@ -2,7 +2,7 @@ import express from "express"; import db from "@repo/db/client"; const app = express(); -app.use(express.json()) +app.use(express.json()) // commnet app.post("/hdfcWebhook", async (req, res) => { //TODO: Add zod validation here? From c084e97a8f0660affaf14db391f773bfcab846f7 Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 21:54:36 +0530 Subject: [PATCH 5/9] commented deploy to EC2 workflow --- .github/workflows/deploy.yml | 26 +++++++++++++------------- Dockerfile | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index acbed6e5..18b6310f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,19 +24,19 @@ jobs: context: . file: ./docker/Dockerfile.user push: true - tags: 100xdevs/week-18-class:latest # Replace with your Docker Hub username and repository + tags: noelleasta69/week-18-cicd:latest # Replace with your Docker Hub username and repository - name: Verify Pushed Image - run: docker pull 100xdevs/week-18-class:latest # Replace with your Docker Hub username and repository + run: docker pull noelleasta69/week-18-cicd:latest # Replace with your Docker Hub username and repository - - name: Deploy to EC2 - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SSH_HOST }} - username: ${{ secrets.SSH_USERNAME }} - key: ${{ secrets.SSH_KEY }} - script: | - sudo docker pull 100xdevs/week-18-class:latest - sudo docker stop web-app || true - sudo docker rm web-app || true - sudo docker run -d --name web-app -p 3005:3000 100xdevs/week-18-class:latest \ No newline at end of file + # - name: Deploy to EC2 + # uses: appleboy/ssh-action@master + # with: + # host: ${{ secrets.SSH_HOST }} + # username: ${{ secrets.SSH_USERNAME }} + # key: ${{ secrets.SSH_KEY }} + # script: | + # sudo docker pull 100xdevs/week-18-class:latest + # sudo docker stop web-app || true + # sudo docker rm web-app || true + # sudo docker run -d --name web-app -p 3005:3000 100xdevs/week-18-class:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..d8cde5b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:20.12.0-alpine3.19 + +WORKDIR /usr/src/app + +COPY package.json package-lock.json turbo.json tsconfig.json ./ + +COPY apps ./apps +COPY packages ./packages + +# Install dependencies +RUN npm install +# Can you add a script to the global package.json that does this? +RUN npm run db:generate + +# Can you filter the build down to just one app? +RUN npm run build + +CMD ["npm", "run", "start-user-app"] \ No newline at end of file From 35aed42e501fbf0102f8240f31dec3d56c521868 Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 21:59:00 +0530 Subject: [PATCH 6/9] . --- .github/workflows/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 18b6310f..ddfdc441 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,8 @@ jobs: - name: Verify Pushed Image run: docker pull noelleasta69/week-18-cicd:latest # Replace with your Docker Hub username and repository + + # - name: Deploy to EC2 # uses: appleboy/ssh-action@master # with: From 269dd18a3d13b8b376278eb0a54c4d049452f1be Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:03:18 +0530 Subject: [PATCH 7/9] . --- .github/workflows/deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ddfdc441..18b6310f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,8 +29,6 @@ jobs: - name: Verify Pushed Image run: docker pull noelleasta69/week-18-cicd:latest # Replace with your Docker Hub username and repository - - # - name: Deploy to EC2 # uses: appleboy/ssh-action@master # with: From 208e00652ff03361c5cf115dba26da9cf597795a Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:09:23 +0530 Subject: [PATCH 8/9] added test.txt --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 00000000..393b0e1a --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +this is just a timepass file .. delete it . lateer \ No newline at end of file From ef242ebfbb45783d74765f124241a4c1331fc14a Mon Sep 17 00:00:00 2001 From: noelleasta69 <96903600+noelleasta69@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:52:05 +0530 Subject: [PATCH 9/9] updated test.txt --- test.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.txt b/test.txt index 393b0e1a..a01cd5f7 100644 --- a/test.txt +++ b/test.txt @@ -1 +1,3 @@ -this is just a timepass file .. delete it . lateer \ No newline at end of file +this is just a timepass file .. delete it . lateer + +updateed.. \ No newline at end of file