Skip to content

Test Mondoo Releases with Container Builds #130

Test Mondoo Releases with Container Builds

Test Mondoo Releases with Container Builds #130

name: Test Mondoo Releases with Container Builds
on:
workflow_run:
workflows: ['Update Release Version'] # runs after release
types:
- completed
workflow_dispatch:
push:
branches:
- main
paths:
- 'install.sh'
jobs:
build_container:
runs-on: ubuntu-latest
env:
# C07R9GSGKEU == #mondoo-ops
SLACK_BOT_CHANNEL_ID: "C07R9GSGKEU"
timeout-minutes: 10
strategy:
matrix:
dockerfile:
- "almalinux.Dockerfile"
- "amazonlinux2.Dockerfile"
- "debian.Dockerfile"
- "opensuse_leap.Dockerfile"
- "redhat.Dockerfile"
- "ubuntu.Dockerfile"
name: Install Mondoo
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }}
payload: |
{
"attachments": [
{
"color": "#FFFF00",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "<${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}|${{ github.workflow }}>"
},
{
"type": "mrkdwn",
"text": "*Status:*\n`In Progress`"
}
]
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
context: .
file: test/install_sh/${{ matrix.dockerfile }}
push: false
tags: |
mondoohq/mondoo-install-test:${{ matrix.dockerfile }}
- uses: slackapi/[email protected]
if: always()
with:
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }}
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
{
"attachments": [
{
"color": "${{ job.status == 'success' && '#00FF00' || job.status == 'failure' && '#FF0000' || '#FFA500' }}",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "<${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}|${{ github.workflow }}>"
},
{
"type": "mrkdwn",
"text": "*Status:*\n`${{ job.status }}`"
}
]
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}