diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml index 34c715f..826bb1f 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker.yml @@ -60,7 +60,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v5 with: - context: . + context: ./backend/pms file: ./backend/pms/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ce148c..497ddf9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,33 +45,3 @@ jobs: - name: Build with Maven run: cd backend/pms && mvn clean package - - - name: Build with Maven - run: cd backend/pms && mvn clean package - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/mini-pms - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - - - name: Build and push Docker image - uses: docker/build-push-action@v5 - with: - context: ./backend/pms - file: ./backend/pms/Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file