Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

update self-monitor image to prometheus 2.53.2 (#451) #6

update self-monitor image to prometheus 2.53.2 (#451)

update self-monitor image to prometheus 2.53.2 (#451) #6

name: Telemetry Self Monitor Image Builder
on:
pull_request_target:
paths:
- "telemetry-self-monitor/**"
types: [ opened, edited, synchronize, reopened, ready_for_review ]
push:
branches:
- main
paths:
- "telemetry-self-monitor/**"
jobs:
envs:
runs-on: ubuntu-latest
outputs:
build-args: ${{ steps.prepare-envs.outputs.build-args }}
build-tag: ${{ steps.build-tag.outputs.build-tag || '' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fetch new env file
run: |
git fetch origin ${{ github.event.pull_request.head.sha }}
git checkout ${{ github.event.pull_request.head.sha }} --no-overlay -- telemetry-self-monitor/envs
if: github.event_name == 'pull_request_target'
- name: Prepare Envs
id: prepare-envs
run: |
{
# this creates a multiline string with the envs.
# Everything between `build-args<<BUILD_ARGS` and BUILD_ARGS will be content of the build-args variable.
echo 'build-args<<BUILD_ARGS'
cat telemetry-self-monitor/envs
echo BUILD_ARGS
} >> "$GITHUB_OUTPUT"
- name: load envs into output
id: load-envs
run: |
cat telemetry-self-monitor/envs >> "$GITHUB_OUTPUT"
- name: get commit short sha
id: get-short-sha
run: echo "short-sha=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
- name: build image tag
id: build-tag
run: echo "build-tag=${{ steps.load-envs.outputs.PROMETHEUS_VERSION }}-${{ steps.get-short-sha.outputs.short-sha }}" >> $GITHUB_OUTPUT
if: github.event_name == 'push'
build-image:
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: tpi/telemetry-self-monitor
dockerfile: Dockerfile
context: telemetry-self-monitor
build-args: ${{ needs.envs.outputs.build-args }}
tags: ${{ needs.envs.outputs.build-tag }}
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: List images
run: |
echo "${{ needs.build-image.outputs.images }}"