Skip to content

Add partmap.Map Mutate function #39

Add partmap.Map Mutate function

Add partmap.Map Mutate function #39

name: Publish container images
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: true
matrix:
include:
# github.repository as <account>/<repo>
- dockerfile: build/images/Dockerfile.alerter
image: ghcr.io/${{ github.repository }}/alerter
- dockerfile: build/images/Dockerfile.collector
image: ghcr.io/${{ github.repository }}/collector
- dockerfile: build/images/Dockerfile.ingestor
image: ghcr.io/${{ github.repository }}/ingestor
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up BuildKit Docker container builder to be able to build images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
# Use latest tag on default branch (main), otherwise use the tag
tags: |
type=raw, value=latest, enable={{is_default_branch}}
type=ref, event=tag
flavor: |
latest=false
# Build and push Docker image with Buildx
- name: Build and push image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
GIT_COMMIT=${{ github.sha }}
BUILD_TIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}