diff --git a/.github/workflows/build-and-push-container-image.yml b/.github/workflows/build-and-push-container-image.yml index 8521389..81d8373 100644 --- a/.github/workflows/build-and-push-container-image.yml +++ b/.github/workflows/build-and-push-container-image.yml @@ -1,9 +1,12 @@ name: build and push container image on: - pull_request: push: - branches: [main] + branches: + - main + tags: + - '*.*.*' + workflow_dispatch: env: REGISTRY: ghcr.io @@ -43,8 +46,10 @@ jobs: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}},value=${{ env.VERSION }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }},enable=${{ startsWith(github.ref, 'refs/tags/') }} + type=semver,pattern={{major}},value=${{ env.VERSION }},enable=${{ startsWith(github.ref, 'refs/tags/') }} type=sha - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} - name: build and push uses: docker/build-push-action@v5 with: