diff --git a/.github/workflows/ci-app.yml b/.github/workflows/ci-app.yml index 6b39516..a6425b0 100644 --- a/.github/workflows/ci-app.yml +++ b/.github/workflows/ci-app.yml @@ -24,27 +24,29 @@ 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: . + run: mvn clean package - name: List files - run: ls -R + working-directory: . + run: ls -R - - name: Build Docker Image - run: docker build -t ${{ secrets.DOCKER_USERNAME }}/blog-api-server . + - name: Docker Compose Build + working-directory: . + run: docker compose build - - name: Tag and Push Docker Image + + - name: Push to Docker Hub Container Registry 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