From e6e3548f6f822a850529f176556f6562871658b5 Mon Sep 17 00:00:00 2001 From: Isaac Andrade Date: Wed, 11 Sep 2024 01:11:21 -0300 Subject: [PATCH] Update ci-app.yml --- .github/workflows/ci-app.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-app.yml b/.github/workflows/ci-app.yml index cd3af8b..6b39516 100644 --- a/.github/workflows/ci-app.yml +++ b/.github/workflows/ci-app.yml @@ -24,29 +24,27 @@ jobs: restore-keys: | ${{ runner.os }}-maven- + - name: Build Application JAR + run: mvn clean package + - name: Login to Docker Hub uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - - name: Build Application JAR - working-directory: ./home/runner/work/blog-api-server - run: mvn clean package - name: List files - working-directory: ./home/runner/work/blog-api-server - run: ls -R + run: ls -R - - name: Docker Compose Build - working-directory: ./home/runner/work/blog-api-server - run: docker compose build + - name: Build Docker Image + run: docker build -t ${{ secrets.DOCKER_USERNAME }}/blog-api-server . - - - name: Push to Docker Hub Container Registry + - name: Tag and Push Docker Image run: | docker tag ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest ${{ secrets.DOCKER_USERNAME }}/blog-api-server:${{ github.run_id }} docker push ${{ secrets.DOCKER_USERNAME }}/blog-api-server:${{ github.run_id }} docker push ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest + + - name: Run Docker Compose + run: docker-compose -f docker-compose.yml up -d