Skip to content

Commit e1bed23

Browse files
chore: Set tags and labels correctly
1 parent 6f8ad82 commit e1bed23

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/ee.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,33 @@ jobs:
4646
run: |
4747
ls -l ./context
4848
49+
# produce docker tags for semver if on a tag, otherwise take ref branch name
50+
# latest tag is only produced for semver operating on a tag
51+
- name: determine docker tags and labels
52+
id: meta
53+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
54+
with: # labels and annotations are overwritten for image.title information
55+
context: git # git - this ensures to reference the current git context instead of workflow context (context info ref/sha)
56+
images: ghcr.io/paloaltonetworks/panos_policy_automation-rhel9
57+
tags: |
58+
type=semver,pattern=v{{version}}
59+
type=semver,pattern=v{{major}}.{{minor}}
60+
type=semver,pattern=v{{major}}
61+
type=ref,event=branch
62+
type=ref,event=tag
63+
labels: |
64+
org.opencontainers.image.title=panos_policy_automation-rhel9
65+
annotations: |
66+
org.opencontainers.image.title=panos_policy_automation-rhel9
67+
4968
- name: build and publish
5069
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
5170
with:
5271
context: "./context/"
5372
file: "./context/Dockerfile"
5473
push: true
55-
tags: ${{ github.ref_name }}
56-
#labels: ${{ steps.meta.outputs.labels }}
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
5776
cache-from: type=gha
5877
cache-to: type=gha,mode=max
5978
provenance: ${{ inputs.release }}

0 commit comments

Comments
 (0)