Skip to content

Commit

Permalink
cd pipeline added
Browse files Browse the repository at this point in the history
  • Loading branch information
dhanush-2313 committed Sep 22, 2024
1 parent 96503d2 commit e193b08
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Docker Images

on:
push:
branches:
- main

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 User App Image
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile.userapp
push: true
tags: dhanush2313/user-app:latest

- name: Build and Push Webhook Handler Image
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile.webhook
push: true
tags: dhanush2313/webhook-handler:latest

- name: Push Docker Compose File
run: |
docker-compose -f docker-compose.yml push
- name: Verify Pushed User App Image
run: docker pull dhanush2313/user-app:latest

- name: Verify Pushed Webhook Handler Image
run: docker pull dhanush2313/webhook-handler:latest
4 changes: 1 addition & 3 deletions docker/Dockerfile.userapp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ 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"]
4 changes: 0 additions & 4 deletions docker/Dockerfile.webhook
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ RUN npm install

ENV DATABASE_URL=postgresql://postgres:bruh123@db:5432/postgres

# Ensure the schema file is in the correct location
RUN ls -la ./packages/db/prisma/

# Expose the application port
EXPOSE 3003

# Set the working directory to the bank-webhook-handler app
WORKDIR /usr/src/app/apps/bank-webhook-handler

# Run the Prisma commands and then start the application
CMD ["sh", "-c", "npx prisma migrate dev --name init_schema --schema=../../packages/db/prisma/schema.prisma && npx prisma generate --schema=../../packages/db/prisma/schema.prisma && npm run start"]

0 comments on commit e193b08

Please sign in to comment.