From f260cd03a7d6f9ac5d6aca71d33b2fe35c0bce9c Mon Sep 17 00:00:00 2001 From: Vichea <48352653+vicheanath@users.noreply.github.com> Date: Wed, 7 Feb 2024 19:29:48 -0600 Subject: [PATCH] fix: context --- .github/workflows/build-push-docker.yml | 2 +- .github/workflows/test.yml | 30 ------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) 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