Skip to content

chore(deps): lock file maintenance #1991

chore(deps): lock file maintenance

chore(deps): lock file maintenance #1991

Workflow file for this run

name: Create and publish a Docker image
on:
push:
branches: ["main"]
pull_request:
workflow_call:
inputs:
tag-name:
required: true
type: string
outputs:
image_tags:
value: ${{ jobs.build-and-push-image.outputs.image_tags }}
image_url:
value: https://ghcr.io/${{ github.repository }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# tool versions
# renovate: datasource=github-releases depName=docker/buildx
BUILDX_VERSION: v0.19.3
# renovate: datasource=github-releases depName=moby/buildkit
BUILDKIT_VERSION: v0.18.2
jobs:
build-and-push-image:
runs-on: ubuntu-24.04
outputs:
image_tags: ${{ steps.meta.outputs.tags }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=moby/buildkit:${{ env.BUILDKIT_VERSION }}
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ inputs.tag-name }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag-name }}
type=semver,pattern={{major}},value=${{ inputs.tag-name }}
type=edge
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max