From 1f3926968c8c11490bd5d114d52c46e68680316e Mon Sep 17 00:00:00 2001 From: Rishi Sharma Date: Fri, 8 Nov 2024 20:56:31 +0100 Subject: [PATCH] Create docker-image.yml --- .github/workflows/docker-image.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 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..6e04b75 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,32 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - '*' # Trigger on any tag push + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Make docker-build.sh executable + run: chmod +x docker-build.sh + + - name: Build Docker image using docker-build.sh + run: ./docker-build.sh + + - name: Tag Docker image + run: docker tag shatter-artifact-pets2025 rishis8/shatter-artifact-pets2025:${{ github.ref_name }} + + - name: Push Docker image + run: docker push rishis8/shatter-artifact-pets2025:${{ github.ref_name }}