From 50487c7c3af4b7b6785afaf0b583e0f372b5c149 Mon Sep 17 00:00:00 2001 From: Joe S George <32813415+joesajigeorge@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:02:29 +0530 Subject: [PATCH] Create docker-image.yml --- .github/workflows/docker-image.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..1a17fa1 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,33 @@ +name: NodeJS Docker Demo + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + IMAGE_NAME: sajigeorgejoe/my_node_app + IMAGE_TAG: github + +jobs: + build_image: + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6.0.1 + with: + context: . + file: ./Dockerfile + push: true + tags: $IMAGE_NAME:$IMAGE_TAG