Skip to content

Commit

Permalink
Merge pull request #54 from Ayush272002/feat/cd
Browse files Browse the repository at this point in the history
add cd pipeline
  • Loading branch information
highjeans authored Dec 10, 2024
2 parents c67ede2 + 0c248b8 commit aae72b5
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build, Deploy, and Verify Docker Images

on:
push:
branches:
- main

jobs:
build-deploy-verify:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push backend image
run: |
docker build -f docker/Dockerfile.backend -t ayush272002/automarker-backend:latest .
docker push ayush272002/automarker-backend:latest
- name: Build and push engine image
run: |
docker build -f docker/Dockerfile.mm -t ayush272002/automarker-engine:latest .
docker push ayush272002/automarker-engine:latest
- name: Verify backend image by pulling
run: |
docker pull ayush272002/automarker-backend:latest
docker images | grep ayush272002/automarker-backend
- name: Verify engine image by pulling
run: |
docker pull ayush272002/automarker-engine:latest
docker images | grep ayush272002/automarker-engine
18 changes: 18 additions & 0 deletions docker/Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:20.12.0-alpine3.19

WORKDIR /app

COPY .gitignore .npmrc prettier.config.js ./
COPY package.json package-lock.json turbo.json ./

COPY apps ./apps
COPY packages ./packages

RUN npm install

RUN npm run db:generate
RUN npm run build

EXPOSE 8000

CMD ["npm", "run", "start:backend"]
17 changes: 17 additions & 0 deletions docker/Dockerfile.engine
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:20.12.0-alpine3.19

WORKDIR /app

COPY .gitignore .npmrc prettier.config.js ./
COPY package.json package-lock.json turbo.json ./

COPY apps ./apps
COPY packages ./packages

RUN npm install

RUN npm run db:generate
RUN npm run build


CMD ["npm", "run", "start:engine"]

0 comments on commit aae72b5

Please sign in to comment.