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 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 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? 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