Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/cicd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
- name: Login to docker hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: docker build -t integrationninjas/nodejs-app .
run: docker build -t karthi2611/nodejs-githubaction .
- name: Publish image to docker hub
run: docker push integrationninjas/nodejs-app:latest
run: docker push karthi2611/nodejs-githubaction:latest

deploy:
needs: build
runs-on: [aws-ec2]
steps:
- name: Pull image from docker hub
run: docker pull integrationninjas/nodejs-app:latest
- name: Delete old container
run: docker rm -f nodejs-app-container
- name: Run docker container
run: docker run -d -p 5000:5000 --name nodejs-app-container integrationninjas/nodejs-app
# deploy:
# needs: build
# runs-on: [aws-ec2]
# steps:
# - name: Pull image from docker hub
# run: docker pull integrationninjas/nodejs-app:latest
# - name: Delete old container
# run: docker rm -f nodejs-app-container
# - name: Run docker container
# run: docker run -d -p 5000:5000 --name nodejs-app-container integrationninjas/nodejs-app
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#Dockerfile
FROM node:16.20.1
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD ["npm","run","start"]
CMD ["npm","run","start"]


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nodejs app with rest and graphql example

An example of GraphQL queries/mutations with Node and Express js.
An example of GraphQL queries/mutations with Node and Express js...

With GraphQL, clients can specify exactly what data they need, and the server responds with only that data, reducing the amount of data transferred over the network.

Expand Down