Skip to content

*: Initial commit

*: Initial commit #2

name: Docker Build
on:
push:
branches: ['**']
tags: ['**']
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
types: [opened, reopened]
branches: [main]
paths-ignore:
- 'README.md'
- 'LICENSE'
release:
types: [published]
jobs:
call-docker-build:
name: Call Docker Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Collect Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=false
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and publish Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: |
linux/amd64
linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=min
cache-from: type=gha