ci - pre-commit autoupdate #18
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
# SPDX-FileCopyrightText: none | |
# SPDX-License-Identifier: CC0-1.0 | |
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: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }} | |
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 |