diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 52cedd10..7ca91b10 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,6 +2,8 @@ name: Docker on: push: + branches: + - master tags: - "*" @@ -33,8 +35,9 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image + - name: Build and push Docker image (latest) uses: docker/build-push-action@v5 + if: startsWith(github.ref, 'refs/tags/') with: context: . push: true @@ -42,3 +45,12 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ github.ref_name }} + + - name: Build and push Docker image (branch) + uses: docker/build-push-action@v5 + if: startsWith(github.ref, 'refs/heads') + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}