Skip to content

Commit

Permalink
Labels for automatic push without prefix letter v
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteherrera committed Oct 31, 2020
1 parent 7aa8955 commit 4d60601
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,18 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT_PKG }}
- name: Prepare version major
id: prepare_version_major
- name: Prepare version labels
id: prepare_version_labels
env:
VERSION_FULL: ${{ github.event.release.tag_name }}
VERSION_TAG: ${{ github.event.release.tag_name }}
run: |
echo "Version full: $VERSION_FULL"
VERSION_MAJOR=$(echo $VERSION_FULL | sed 's/[^0-9]*\([0-9]\+\).*/\1/')
echo "Version tag: $VERSION_TAG"
VERSION_MAJOR=$(echo $VERSION_TAG | sed 's/[^0-9]*\([0-9]\+\).*/\1/')
VERSION_FULL=$(echo $VERSION_TAG | sed 's/[^0-9]*\([0-9]\+.*\)/\1/')
echo "Version major: $VERSION_MAJOR"
echo "Version full: $VERSION_FULL"
echo "::set-output name=VERSION_MAJOR::$VERSION_MAJOR"
echo "::set-output name=VERSION_FULL::$VERSION_FULL"
- name: Build and push - Installer
uses: docker/build-push-action@v2
with:
Expand All @@ -227,8 +230,8 @@ jobs:
push: true
tags: |
sysdiglabs/aks-audit-log-installer:latest
sysdiglabs/aks-audit-log-installer:${{ github.event.release.tag_name }}
sysdiglabs/aks-audit-log-installer:${{ steps.prepare_version_major.outputs.VERSION_MAJOR }}
sysdiglabs/aks-audit-log-installer:${{ steps.prepare_version_labels.outputs.VERSION_MAJOR }}
sysdiglabs/aks-audit-log-installer:${{ steps.prepare_version_labels.outputs.VERSION_FULL }}
- name: Build and push - Forwarder
uses: docker/build-push-action@v2
with:
Expand All @@ -238,5 +241,5 @@ jobs:
push: true
tags: |
sysdiglabs/aks-audit-log-forwarder:latest
sysdiglabs/aks-audit-log-forwarder:${{ github.event.release.tag_name }}
sysdiglabs/aks-audit-log-forwarder:${{ steps.prepare_version_major.outputs.VERSION_MAJOR }}
sysdiglabs/aks-audit-log-forwarder:${{ steps.prepare_version_labels.outputs.VERSION_MAJOR }}
sysdiglabs/aks-audit-log-forwarder:${{ steps.prepare_version_labels.outputs.VERSION_FULL }}

0 comments on commit 4d60601

Please sign in to comment.