Skip to content

Merge branch 'main' of https://github.com/kyma-project/telemetry-manager #10

Merge branch 'main' of https://github.com/kyma-project/telemetry-manager

Merge branch 'main' of https://github.com/kyma-project/telemetry-manager #10

name: Build Manager Image
permissions:
contents: read
on:
merge_group:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- "main"
- "release-[0-9]+.[0-9]+"
paths-ignore:
- "docs/**"
- "**/*.md"
- "OWNERS"
- "CODEOWNERS"
- "external-images.yaml"
push:
branches:
- "main"
- "release-[0-9]+.[0-9]+"
tags:
- "[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "docs/**"
- "dependencies/**"
- "**/*.md"
- "OWNERS"
- "CODEOWNERS"
- "external-images.yaml"
jobs:
envs:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.create-tags.outputs.tags }}
steps:
- name: Create tags
id: create-tags
run: |
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
{
echo "TAGS<<EOTAGS"
echo "${{ github.ref_name }}"
echo "${{ github.ref_name }}-experimental"
echo "EOTAGS"
} >> "$GITHUB_OUTPUT"
elif [[ $GITHUB_EVENT_NAME == 'merge_group' ]]; then
echo 'TAGS=${{ github.event.merge_group.head_sha }}' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
echo 'PR-${{ github.event.pull_request.number }}'
echo '${{ github.event.pull_request.head.sha }}'
echo 'TAGS'
} >> "$GITHUB_OUTPUT"
fi
build-image:
permissions:
id-token: write # Required for requesting the JWT token
contents: read
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: telemetry-manager
dockerfile: Dockerfile
context: .
tags: ${{ needs.envs.outputs.tags }}
platforms: "linux/amd64,linux/arm64"
notify-on-failure:
needs: build-image
runs-on: ubuntu-latest
if: ${{ always() && (needs.build-image.result == 'failure') && github.event_name == 'push' }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Send slack message on failure
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: ""
blocks:
- type: "section"
text:
type: "mrkdwn"
text: "Workflow <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|*Telemetry ${{ github.workflow }}*> has status *${{ needs.build-image.result }}*"
- type: "section"
text:
type: "mrkdwn"
text: "See related PR/Commit <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|${{ github.event.pull_request.title || github.event.head_commit.message }}> by *${{ github.event.pull_request.user.login || github.event.head_commit.author }}*"