Skip to content

Build Docker Images

Build Docker Images #2

Workflow file for this run

name: Build Docker Images
# reusable workflow, do not add triggers
on:
workflow_call:
workflow_dispatch:
env:
repo_names: |
ghcr.io/${{ github.repository }}
platforms: linux/amd64,linux/arm64
jobs:
build-docker-images:
name: Build Docker Images
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up docker buildx for push
uses: docker/setup-buildx-action@v3
with:
driver: docker
platforms: ${{ env.platforms }}
- name: Metadata for container
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.repo_names }}
tags: |
type=raw,value={{sha}}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Build Docker Image
id: build-docker
uses: docker/build-push-action@v5
with:
target: release
push: true
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.platforms }}
tags: ${{ steps.meta.outputs.tags }}