Skip to content

Add detection of leading-dot to optional_data_string_conversion rul… #2137

Add detection of leading-dot to optional_data_string_conversion rul…

Add detection of leading-dot to optional_data_string_conversion rul… #2137

Workflow file for this run

name: Docker
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/docker.yml'
- 'Dockerfile'
workflow_call:
inputs:
tag:
description: 'Docker tag'
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: 'Docker tag'
required: true
type: string
jobs:
set-context:
name: Set Context
runs-on: ubuntu-slim
permissions: {}
outputs:
checkout-ref: ${{ steps.vars.outputs.checkout-ref }}
docker-tag: ${{ steps.vars.outputs.docker-tag }}
repository-lc: ${{ steps.vars.outputs.repository-lc }}
steps:
- name: Define variables
id: vars
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
{
echo "checkout-ref=main"
echo "docker-tag=latest"
} >> "$GITHUB_OUTPUT"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
{
echo "checkout-ref=pr"
echo "docker-tag=pr-${{ github.event.pull_request.number }}"
} >> "$GITHUB_OUTPUT"
else
{
echo "checkout-ref=${INPUTS_TAG}"
echo "docker-tag=${INPUTS_TAG}"
} >> "$GITHUB_OUTPUT"
fi
echo "repository-lc=${REPOSITORY,,}" >> "$GITHUB_OUTPUT"
env:
REPOSITORY: ${{ github.repository }}
INPUTS_TAG: ${{ inputs.tag }}
build-amd64:
name: Build AMD64 Image
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
needs: set-context
steps:
- &checkout-step-pr
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: needs.set-context.outputs.checkout-ref == 'pr'
with:
persist-credentials: false
- &checkout-step-ref
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: needs.set-context.outputs.checkout-ref != 'pr'
with:
ref: ${{ needs.set-context.outputs.checkout-ref }}
persist-credentials: false
- uses: ./.github/actions/docker-build
with:
platform: amd64
token: ${{ secrets.GITHUB_TOKEN }}
build-arm64:
name: Build ARM64 Image
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
needs: set-context
steps:
- *checkout-step-pr
- *checkout-step-ref
- uses: ./.github/actions/docker-build
with:
platform: arm64
token: ${{ secrets.GITHUB_TOKEN }}
merge:
name: Create Multi-Platform Image
runs-on: ubuntu-24.04
permissions:
packages: write
needs:
- set-context
- build-amd64
- build-arm64
steps:
- name: Download digests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to GitHub registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Create manifest list and push
working-directory: /tmp/digests
run: >-
docker buildx imagetools create
-t "ghcr.io/${{ needs.set-context.outputs.repository-lc }}:${{ needs.set-context.outputs.docker-tag }}"
$(printf 'ghcr.io/${{ needs.set-context.outputs.repository-lc }}@sha256:%s ' *)