ci(actions): try generating metadata with docker/metadata-action@v5 #503
Workflow file for this run
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: Build images | |
on: | |
push: | |
env: | |
BASE_IMAGE_NAME: openvk | |
DB_IMAGE_NAME: mariadb | |
EVENT_IMAGE_NAME: mariadb | |
DB_VERSION: "10.9" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Change repository string to lowercase | |
id: repositorystring | |
uses: Entepotenz/change-string-case-action-min-dependencies@v1.1.0 | |
with: | |
string: ${{ github.repository }} | |
- name: Base image meta | |
id: basemeta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ steps.repositorystring.outputs.lowercase }}/${{env.BASE_IMAGE_NAME}} | |
tags: | | |
type=sha | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: MariaDB primary meta | |
id: db-primarymeta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ steps.repositorystring.outputs.lowercase }}/${{env.DB_IMAGE_NAME}} | |
tags: | | |
type=sha | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=raw,value=,enable={{is_default_branch}} | |
flavor: | | |
latest=auto | |
prefix=${{env.DB_VERSION}}-primary | |
- name: MariaDB event meta | |
id: db-eventmeta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ steps.repositorystring.outputs.lowercase }}/${{env.DB_IMAGE_NAME}} | |
tags: | | |
type=sha | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=raw,value=,enable={{is_default_branch}} | |
flavor: | | |
latest=auto | |
prefix=${{env.DB_VERSION}}-eventdb- | |
# - name: Log into registry | |
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build base image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: install/automated/docker/openvk.Dockerfile | |
tags: ${{ steps.basemeta.outputs.tags }} | |
labels: ${{ steps.basemeta.outputs.labels }} | |
build-args: | | |
GITREPO=${{ steps.repositorystring.outputs.lowercase }} | |
- name: Build MariaDB primary image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: install/automated/docker/mariadb-primary.Dockerfile | |
tags: ${{ steps.db-primarymeta.outputs.tags }} | |
labels: ${{ steps.db-primarymeta.outputs.labels }} | |
build-args: | | |
VERSION=${{env.DB_VERSION}} | |
- name: Build MariaDB event image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: install/automated/docker/mariadb-eventdb.Dockerfile | |
tags: ${{ steps.db-eventmeta.outputs.tags }} | |
labels: ${{ steps.db-eventmeta.outputs.labels }} | |
build-args: | | |
VERSION=${{env.DB_VERSION}} |