-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from Ayush272002/feat/cd
add cd pipeline
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |