Skip to content

Commit 04cbfcf

Browse files
Added GH action job to publish installer image on release published
1 parent 4b04773 commit 04cbfcf

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/build.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,48 @@ jobs:
178178
image-tag: "sysdiglabs/aks-audit-log-installer"
179179
sysdig-secure-token: ${{ secrets.KUBELAB_SECURE_API_TOKEN }}
180180

181+
publish_images:
182+
name: Publish container images to registries
183+
needs: [check_bash_installer, check_yaml, check_dotnet, sysdig_image_scan, sysdig_image_scan_forwared, sysdig_image_scan_installer]
184+
if: github.event_name == 'release'
185+
steps:
186+
- name: Checkout
187+
uses: actions/checkout@v2
188+
- name: Set up QEMU
189+
uses: docker/setup-qemu-action@v1
190+
- name: Set up Docker Buildx
191+
uses: docker/setup-buildx-action@v1
192+
- name: Login to DockerHub
193+
uses: docker/login-action@v1
194+
with:
195+
username: ${{ secrets.SYSDIGLABS_DOCKERHUB_USER }}
196+
password: ${{ secrets.SYSDIGLABS_DOCKERHUB_TOKEN }}
197+
# - name: Login to GitHub Container Registry
198+
# uses: docker/login-action@v1
199+
# with:
200+
# registry: ghcr.io
201+
# username: ${{ github.repository_owner }}
202+
# password: ${{ secrets.CR_PAT }}
203+
- name: Prepare version major
204+
id: prepare_version_major
205+
env:
206+
VERSION_FULL: ${{ github.event.release.tag_name }}
207+
run: |
208+
echo "Version full: $VERSION_FULL"
209+
VERSION_MAJOR=$(echo $VERSION_FULL | sed 's/[^0-9]*\([0-9]\+\).*/\1/')
210+
echo "Version major: $VERSION_MAJOR"
211+
echo "::set-output name=VERSION_MAJOR::$VERSION_MAJOR"
212+
213+
- name: Build and push - Installer
214+
uses: docker/build-push-action@v2
215+
with:
216+
context: .
217+
file: ./build/Dockerfile
218+
platforms: linux/amd64
219+
push: true
220+
tags: |
221+
sysdiglabs/aks-audit-log-installer:latest
222+
sysdiglabs/aks-audit-log-installer:${{ github.event.release.tag_name }}
223+
sysdiglabs/aks-audit-log-installer:${{ steps.prepare_version_major.outputs.VERSION_MAJOR }}
224+
# ghcr.io/user/app:latest
225+
# ghcr.io/user/app:1.0.0

0 commit comments

Comments
 (0)