From f1f16199968d124d1ed49d94342267be7a287cc1 Mon Sep 17 00:00:00 2001 From: deyvisonborges Date: Tue, 23 Apr 2024 09:48:38 -0300 Subject: [PATCH] #001 - adjusts on workflow --- .github/workflows/ci.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eb466e3..f8b8b06 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,22 +47,18 @@ jobs: - name: Build with Gradle Wrapper run: ./gradlew clean build -x test - - name: Set build tag - run: echo "BUILD_TAG=$(echo ${{ github.head_ref || github.ref }} | sed 's,/,_,g')-${{ github.run_number }}" >> $GITHUB_ENV - - - name: Print BUILD_TAG - run: echo "Branch ---> ${{ github.head_ref || github.ref }}" && echo "Tag ---> ${{ env.BUILD_TAG }}" - - - name: Login to DockerHub + - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set env + run: echo "DATE=$(date +%s)" >> $GITHUB_ENV + - name: Build and push image uses: docker/build-push-action@v3 with: context: . push: true - build-args: VERSION=${{ env.BUILD_TAG }} - tags: ${{ env.IMAGE_NAME }}:${{ env.BUILD_TAG }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.DATE }}