From d52f950cfe2402658090bba67f43326e981f2cd1 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur Date: Thu, 7 Dec 2023 07:38:48 +0100 Subject: [PATCH] docker push workflow --- .github/workflows/dockerhub.yml | 26 ++++++++++++++++++++++++++ Makefile | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000000..3e11f8131c --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,26 @@ +name: Build and Push Docker Image to Docker Hub + +on: + push: + branches: + - main + +jobs: + build_and_push: + name: Build and Push Docker image using Makefile + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker Image + run: make docker diff --git a/Makefile b/Makefile index e66f41ab45..986034c0fc 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,9 @@ test: docker: docker build -t autotrain-advanced:latest . docker tag autotrain-advanced:latest huggingface/autotrain-advanced:latest + docker tag autotrain-advanced:latest huggingface/autotrain-advanced-api:latest docker push huggingface/autotrain-advanced:latest + docker push huggingface/autotrain-advanced-api:latest ngc: docker build -t autotrain-advanced:latest .