Skip to content

Commit

Permalink
gh: trigger on tag, image major,minor,latest on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
irq0 committed Mar 9, 2024
1 parent 96e7595 commit f82e1ad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build-and-push-container-image.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f82e1ad

Please sign in to comment.