Skip to content

CI

CI #554

Workflow file for this run

name: CI
env:
IMAGE_NAME: activemq-artemis-broker-init
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
snapshot:
description: 'Snapshot'
required: false
default: false
type: boolean
trigger_children:
description: 'Trigger children'
required: false
default: false
type: boolean
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Execute the tests
run: ./run_test.sh
- name: Update base image
if: ${{ inputs.snapshot }}
run: |
BASE_IMAGE="quay.io/${{ secrets.QUAY_NAMESPACE }}/activemq-artemis-broker-kubernetes@$(skopeo inspect docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/activemq-artemis-broker-kubernetes:snapshot | jq -r '.Digest')"
sed -i "s~FROM.*~FROM ${BASE_IMAGE}~g" Dockerfile
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build the image
run: |
podman build --label quay.expires-after=90d --label git-sha=$GITHUB_SHA --no-cache --platform linux/amd64 --platform linux/arm64 --manifest $IMAGE_NAME:dev.latest .
- name: Check the image
run: podman run $IMAGE_NAME:dev.latest yacfg --profile artemis/2.15.0/default_with_user_address_settings.yaml.jinja2
- name: Push the dev image
if: ${{ github.event_name == 'push' }}
run: |
COMMIT_TAG=dev.$(date +%Y%m%d).$(git rev-parse --short "$GITHUB_SHA")
podman login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:$COMMIT_TAG
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:dev.latest
- name: Push the snapshot image
if: ${{ github.event_name == 'schedule' || inputs.snapshot }}
run: |
podman login --username=${{ secrets.QUAY_USERNAME }} --password=${{ secrets.QUAY_PASSWORD }} quay.io
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:snapshot