Skip to content

ci

ci #4

Workflow file for this run

name: ci
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
BASE_IMAGE_NAME: ${{ github.repository }}-base
IMAGE_NAME: ${{ github.repository }}
ENABLE_ARTIFACT_ATTESTATION: ${{ vars.ENABLE_ARTIFACT_ATTESTATION || 'false' }}
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- 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 }}
# only available for paid plans
- name: Generate artifact attestation for Base RabbitMQ Docker image
if: ${{ env.ENABLE_ARTIFACT_ATTESTATION == 'true' }}
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 RabbitMQ Docker image
id: push
uses: docker/build-push-action@v5
with:
build-args: |
BASE_IMAGE_TAG=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME}}:main
context: .
file: Dockerfile.dev
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# only available for paid plans
- name: Generate artifact attestation for RabbitMQ Docker image
if: ${{ env.ENABLE_ARTIFACT_ATTESTATION == 'true' }}
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true