From f2090c04e15a8ccc9c61d25c7aaccffee44d73a4 Mon Sep 17 00:00:00 2001 From: Januda Bethmin Date: Thu, 8 Aug 2024 16:37:27 +0530 Subject: [PATCH] docker workflow created --- .github/workflows/docker-build.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..0ec31fc --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,31 @@ +# Pipeline to build and push Docker image to Docker Hub when there are changes in the main branch +# Going to use actions from -> https://github.com/marketplace?query=docker +name: Docker Build and Push Docker Image +run-name: Build and Push Docker Image +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + docker: + name: Build and Push Docker Image + runs-on: ubuntu-latest + steps: + # Checkout the code + - name: Checkout + uses: actions/checkout@v4 + # Login to Docker Hub + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{secrets.DOCKER_USERNAME}} # Docker Hub username + password: ${{secrets.DOCKER_PASSWORD}} # Docker Hub password + # Build the Docker image + - name: Build anf Push Docker Image + uses: docker/build-push-action@v6 + with: + push: true + tags: itzzjb/docker-react:latest