Skip to content

Multiplatform docker images #14

Multiplatform docker images

Multiplatform docker images #14

Workflow file for this run

name: Docker build & publish
on:
push:
branches:
- main
- develop
tags:
- "*"
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on:
- self-hosted
- ${{ matrix.runner }}
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
include:
- arch: linux/arm64
arch-tag: arm64
runner: ARM64
- arch: linux/amd64
arch-tag: x86
runner: X64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Install cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.4'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Define metadata (tags) for Docker
id: meta
run: |
TAG="latest"
if [ "${{ github.ref_type }}" == "tag" ]; then
TAG=${{ github.ref_name }}
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Build and push Docker server image
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.arch }}
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/media-gateway-server-${{ matrix.arch-tag }}:${{ steps.meta.outputs.tag}}
build-args: |
TYPE=server
- name: Build and push Docker client image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
platforms: ${{ matrix.arch }}
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/media-gateway-client-${{ matrix.arch-tag }}:${{ steps.meta.outputs.tag}}
build-args: |
TYPE=client