Skip to content

Commit

Permalink
use docker metadata action to generate tags
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Sep 27, 2023
1 parent 7436ac7 commit 5d2d546
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/cnspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ jobs:

strategy:
matrix:
os: [linux]
tag:
- ${{ github.event.inputs.version }}
- ${{ github.event.inputs.version }}-rootless
- ${{ github.event.inputs.version }}-ubi-rootless
- ${{ github.event.inputs.version }}-ubi
suffix:
- ""
- -rootless
- -ubi-rootless
- -ubi

steps:
- name: Checkout repository
Expand All @@ -44,6 +43,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern={{version}},value=${{ github.event.inputs.version }}
type=semver,pattern={{major}},value=${{ github.event.inputs.version }}
type=raw,value=latest
flavor: |
suffix=${{ matrix.suffix }},onlatest=true
- name: Build and push cnspec image
id: build-and-push-operator
uses: docker/build-push-action@v4
Expand All @@ -54,4 +65,4 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.IMAGE }}:${{ matrix.tag }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 5d2d546

Please sign in to comment.