diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..bbe7103 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,36 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: 'npm' + - run: npm install + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: "gopi123321" + password: "Lanka@143" + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: gopi123321/test:1.1 + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e3d70d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:latest +RUN apt-get clean all && apt-get update -y && apt-get upgrade -y && apt-get install npm -y +WORKDIR /service +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 8080 +CMD [ "node", "npm-start" ]