diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97c6860..6dfc28e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: Build on: push: + branches: + - 'sbdi-dev' tags: - 'v*' @@ -33,6 +35,7 @@ jobs: path: build/libs - name: Log in to the Container registry + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: docker/login-action@v2 with: registry: ghcr.io @@ -40,12 +43,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') id: meta uses: docker/metadata-action@v4 with: images: ghcr.io/${{ github.repository }} - name: Build and push Docker image + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: docker/build-push-action@v4 with: context: .