-
Notifications
You must be signed in to change notification settings - Fork 31
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 #42 from RohanRusta21/master
Added Dockerfile and created Github Action CI pipeline to push dockerized Image to Docker Registery
- Loading branch information
Showing
4 changed files
with
21,740 additions
and
6,707 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,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 }} |
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,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"] |
Oops, something went wrong.