Skip to content

Commit

Permalink
ci: build 2 RabbitMQ images
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed May 9, 2024
1 parent 936561b commit 357280a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

env:
REGISTRY: ghcr.io
BASE_IMAGE_NAME: ${{ github.repository }}-base
IMAGE_NAME: ${{ github.repository }}

jobs:
Expand All @@ -15,6 +16,7 @@ jobs:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
Expand All @@ -33,22 +35,47 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
- name: Extract metadata (tags, labels) for Base RabbitMQ Docker image
id: meta-base
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}

- name: Build and push Base RabbitMQ Docker image
id: push-base
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}

- name: Generate artifact attestation for Base RabbitMQ Docker image
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME}}
subject-digest: ${{ steps.push-base.outputs.digest }}
push-to-registry: true

- name: Extract metadata (tags, labels) for RabbitMQ Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
- name: Build and push RabbitMQ Docker image
id: push
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE_TAG=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME}}:${{ steps.push-base.outputs.digest }}
context: .
file: Dockerfile.dev
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
- name: Generate artifact attestation for RabbitMQ Docker image
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/innovation-system/on-board-rabbitmq/rabbitmq-base:3.12.13
ARG BASE_IMAGE_TAG=ghcr.io/innovation-system/on-board-rabbitmq-base:main

FROM ${BASE_IMAGE_TAG}
# FROM rabbitmq:3.12.4-management-alpine

ARG RABBITMQ_PLUGINS="rabbitmq_management_agent rabbitmq_management rabbitmq_mqtt rabbitmq_web_mqtt rabbitmq_prometheus rabbitmq_web_dispatch rabbitmq_auth_backend_http rabbitmq_auth_backend_cache rabbitmq_event_exchange rabbitmq_mqtt_retained_msg_store_redis rabbitmq_stream"
Expand Down

0 comments on commit 357280a

Please sign in to comment.