From 3f5750835e4fafe209de8305bd75bd425377a9b2 Mon Sep 17 00:00:00 2001 From: Victor Ross Date: Sat, 12 Oct 2024 08:32:14 -0300 Subject: [PATCH] WORKFLOW: Try to make it work --- .github/workflows/docker-image.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 013a5e7..bec52c9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Build and Run Docker Image +name: Build and Push Docker Image on: push: @@ -16,8 +16,18 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Build Docker image - run: docker build -t my-app:latest ./api + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: ./api + push: true + tags: vicross22/calculadora-renda:latest - name: Run Docker container - run: docker run -d -p 8080:8080 --name di di:latest + run: docker run -d -p 8080:8080 --name calculadora-renda vicross22/calculadora-renda:latest