Skip to content

feat: Docker builds

feat: Docker builds #1

Workflow file for this run

name: Build Docker image
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
with:
config: .github/buildkitd.toml
- name: Retrieve author data
run: |
echo AUTHOR=$(curl -sSL ${{ github.event.repository.owner.url }} | jq -r '.name') >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.authors=${{ env.AUTHOR }}
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Inspect Docker image
run: docker image inspect ${{ steps.meta.outputs.tags }}