Skip to content

Main

Main #2979

Workflow file for this run

name: 'Main'
on:
push:
branches:
- main
schedule:
- cron: '0 0,6,12,18 * * *'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPO_NAME: ${{ github.event.repository.name }}
jobs:
container-image:
uses: ./.github/workflows/build-container-image.yml
with:
imageRegistry: ghcr.io
imageName: ${{ github.repository }}
imageBuildContext: ./monitoring-as-code
repositoryName: ${{ github.event.repository.name }}
promtoolImageName: sre-promtool
promtoolVersion: 2.38.0
user: ho-cto
tag: ${{ github.sha }}
secrets: inherit
notify-alerts:
needs: container-image
runs-on: ubuntu-latest
steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
if: ${{ failure() }}
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: GitHub Workflow Failure: ${{github.repository}} :warning:",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Main scheduler workflow has failed!\n\n\n\n\n <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}|View Workflow>"
},
"accessory": {
"type": "image",
"image_url": "https://ca.slack-edge.com/T03TJ3P61-U034J2897V0-1d3e4b813a11-72",
"alt_text": "cute cat"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}