From 4d1f78a172a00d73659e026af423f06161ed8504 Mon Sep 17 00:00:00 2001 From: Subrat Date: Sat, 14 Sep 2024 10:04:46 +0530 Subject: [PATCH 1/5] deleted files --- .github/workflows/build.yml | 25 --------------------- .github/workflows/deploy.yml | 42 ------------------------------------ docker/Dockerfile.user | 18 ---------------- package-lock.json | 13 ++++++----- 4 files changed, 6 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/deploy.yml delete mode 100644 docker/Dockerfile.user diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c8b64f0e..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Build on PR - -on: - pull_request: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Install Dependencies - run: npm install - - - name: Generate prisma client - run: npm run db:generate - - - name: Run Build - run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index acbed6e5..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build and Deploy to Docker Hub - -on: - push: - branches: - - master - -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - name: Check Out Repo - uses: actions/checkout@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and Push Docker image - uses: docker/build-push-action@v2 - with: - context: . - file: ./docker/Dockerfile.user - push: true - tags: 100xdevs/week-18-class: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 - - - 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/docker/Dockerfile.user b/docker/Dockerfile.user deleted file mode 100644 index d8cde5b1..00000000 --- a/docker/Dockerfile.user +++ /dev/null @@ -1,18 +0,0 @@ -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 diff --git a/package-lock.json b/package-lock.json index c5f06ffe..44384142 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1498,7 +1498,6 @@ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "optional": true, - "peer": true, "engines": { "node": ">=14" } @@ -1536,13 +1535,13 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.11.0.tgz", "integrity": "sha512-N6yYr3AbQqaiUg+OgjkdPp3KPW1vMTAgtKX6+BiB/qB2i1TjLYCrweKcUjzOoRM5BriA4idrkTej9A9QqTfl3A==", - "devOptional": true + "dev": true }, "node_modules/@prisma/engines": { "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.11.0.tgz", "integrity": "sha512-gbrpQoBTYWXDRqD+iTYMirDlF9MMlQdxskQXbhARhG6A/uFQjB7DZMYocMQLoiZXO/IskfDOZpPoZE8TBQKtEw==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "@prisma/debug": "5.11.0", @@ -1555,13 +1554,13 @@ "version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102.tgz", "integrity": "sha512-WXCuyoymvrS4zLz4wQagSsc3/nE6CHy8znyiMv8RKazKymOMd5o9FP5RGwGHAtgoxd+aB/BWqxuP/Ckfu7/3MA==", - "devOptional": true + "dev": true }, "node_modules/@prisma/fetch-engine": { "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.11.0.tgz", "integrity": "sha512-994viazmHTJ1ymzvWugXod7dZ42T2ROeFuH6zHPcUfp/69+6cl5r9u3NFb6bW8lLdNjwLYEVPeu3hWzxpZeC0w==", - "devOptional": true, + "dev": true, "dependencies": { "@prisma/debug": "5.11.0", "@prisma/engines-version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", @@ -1572,7 +1571,7 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.11.0.tgz", "integrity": "sha512-rxtHpMLxNTHxqWuGOLzR2QOyQi79rK1u1XYAVLZxDGTLz/A+uoDnjz9veBFlicrpWjwuieM4N6jcnjj/DDoidw==", - "devOptional": true, + "dev": true, "dependencies": { "@prisma/debug": "5.11.0" } @@ -8477,7 +8476,7 @@ "version": "5.11.0", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.11.0.tgz", "integrity": "sha512-KCLiug2cs0Je7kGkQBN9jDWoZ90ogE/kvZTUTgz2h94FEo8pczCkPH7fPNXkD1sGU7Yh65risGGD1HQ5DF3r3g==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "dependencies": { "@prisma/engines": "5.11.0" From 279052d161b79a1154dbbaab6bc398eb6a84a79c Mon Sep 17 00:00:00 2001 From: Subrat Date: Sat, 14 Sep 2024 10:28:39 +0530 Subject: [PATCH 2/5] Added workflow --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..fa3e0d3b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: Build on PR + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Dependencies + run: npm install + + - name: Run Build + run: npm run build \ No newline at end of file From 87c4f606c9e86b643febc5205bafd80e43cdf48c Mon Sep 17 00:00:00 2001 From: Subrat Date: Sat, 14 Sep 2024 10:45:03 +0530 Subject: [PATCH 3/5] updated workflow --- .github/workflows/build.yml | 4 ++++ package.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3e0d3b..bffc081b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,10 @@ jobs: - name: Install Dependencies run: npm install + + + - name: Generate Prisma client + run: npm run db:generate - name: Run Build run: npm run build \ No newline at end of file diff --git a/package.json b/package.json index 4be5bbb6..0df13e80 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "dev": "turbo dev", "lint": "turbo lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", - "db:generate": "cd packages/db && npx prisma generate && cd ../..", - "start-user-app": "cd ./apps/user-app && npm run start" + "db:generate": "cd packages/db && npx prisma generate && cd ../.." + }, "devDependencies": { From e906f6c0111089dc8bf21ae9d998381ea80780ea Mon Sep 17 00:00:00 2001 From: Subrat Date: Sat, 14 Sep 2024 10:48:56 +0530 Subject: [PATCH 4/5] new PR --- apps/user-app/app/(dashboard)/dashboard/page.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/user-app/app/(dashboard)/dashboard/page.tsx b/apps/user-app/app/(dashboard)/dashboard/page.tsx index bba052d2..e0457b17 100644 --- a/apps/user-app/app/(dashboard)/dashboard/page.tsx +++ b/apps/user-app/app/(dashboard)/dashboard/page.tsx @@ -1,4 +1,8 @@ + + + + export default function() { return
Dashboard From 6c703ce3004b7d3cdd1fd0b82cbf4a543d4ac03e Mon Sep 17 00:00:00 2001 From: Subrat Date: Sat, 14 Sep 2024 10:50:01 +0530 Subject: [PATCH 5/5] new PR-2 --- apps/user-app/app/(dashboard)/dashboard/page.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/user-app/app/(dashboard)/dashboard/page.tsx b/apps/user-app/app/(dashboard)/dashboard/page.tsx index e0457b17..97eba6fa 100644 --- a/apps/user-app/app/(dashboard)/dashboard/page.tsx +++ b/apps/user-app/app/(dashboard)/dashboard/page.tsx @@ -1,8 +1,5 @@ - - - export default function() { return
Dashboard