CI #177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
- 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@v1 | |
- 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: | | |
IMAGE_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:dev.latest | |
podman manifest push $IMAGE_NAME:dev.latest docker://quay.io/${{ secrets.QUAY_NAMESPACE }}/$IMAGE_NAME:$IMAGE_TAG | |
- 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 |