ci: push docker image when tag event

This commit is contained in:
zhanghongtong 2022-04-02 10:13:37 +08:00
parent 1d2aa1c8c1
commit e183ae2499
1 changed files with 6 additions and 3 deletions

View File

@ -355,8 +355,9 @@ jobs:
id: meta id: meta
with: with:
images: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ matrix.profile }} images: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ matrix.profile }}
## only stable tag is latest
flavor: | flavor: |
latest=${{ !github.event.release.prerelease }} latest=${{ contains(github.ref, 'tags') && !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'alpha') }}
tags: | tags: |
type=ref,event=branch type=ref,event=branch
type=ref,event=pr type=ref,event=pr
@ -366,7 +367,8 @@ jobs:
- uses: docker/build-push-action@v2 - uses: docker/build-push-action@v2
if: matrix.profile != 'emqx-ee' if: matrix.profile != 'emqx-ee'
with: with:
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }} ## only push when stable tag and rc tag
push: ${{ contains(github.ref, 'tags') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'alpha') }}
pull: true pull: true
no-cache: true no-cache: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
@ -381,7 +383,8 @@ jobs:
- uses: docker/build-push-action@v2 - uses: docker/build-push-action@v2
if: matrix.profile == 'emqx-ee' if: matrix.profile == 'emqx-ee'
with: with:
push: ${{ github.event_name == 'release' && !github.event.release.prerelease }} ## only push when stable tag and rc tag
push: ${{ contains(github.ref, 'tags') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'alpha') }}
pull: true pull: true
no-cache: true no-cache: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64