Skip to content

Commit

Permalink
Merge pull request #42 from RohanRusta21/master
Browse files Browse the repository at this point in the history
Added Dockerfile and created Github Action CI pipeline to push dockerized Image to Docker Registery
  • Loading branch information
Jatin-8898 authored Sep 21, 2024
2 parents 2434911 + 0b20cb2 commit 6274444
Show file tree
Hide file tree
Showing 4 changed files with 21,740 additions and 6,707 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build and Push Docker Image to DockerHub

on:
push:
branches:
- master

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build Docker Image
run: docker build -t "${DOCKERHUB_USERNAME}"/react-quiz-app:${{ github.sha }} .
- name: Login to DockerHub
run: echo "${DOCKERHUB_TOKEN}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
- name: Push Docker Image to DockerHub
run: docker push "${DOCKERHUB_USERNAME}"/react-quiz-app:${{ github.sha }}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:19
LABEL maintainer="Rohan Rustagi"
WORKDIR /app
COPY package.json ./
COPY package-lock*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm","start"]
Loading

0 comments on commit 6274444

Please sign in to comment.