Skip to content

Bump apache/infrastructure-actions/allowlist-check from 775350a154e610e84c460cb1bbe2d2ab26c15cb3 to b5975e69a34b86d3d7e4915221ab932f10c51d80 #212

Bump apache/infrastructure-actions/allowlist-check from 775350a154e610e84c460cb1bbe2d2ab26c15cb3 to b5975e69a34b86d3d7e4915221ab932f10c51d80

Bump apache/infrastructure-actions/allowlist-check from 775350a154e610e84c460cb1bbe2d2ab26c15cb3 to b5975e69a34b86d3d7e4915221ab932f10c51d80 #212

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: build
# This workflow builds the Docker image if it does not exists already.
# For non-PR runs, it also publishes the image to the registry, tagging it by the full SHA of the commit.
on:
pull_request:
types: [opened, ready_for_review, synchronize]
workflow_call:
outputs:
image-id:
description: "Docker image ID in repo/owner/name:tag format"
value: ${{ jobs.build.outputs.image-id }}
concurrency:
group: ${{ github.sha }}
cancel-in-progress: false
permissions: { }
jobs:
build:
runs-on: ubuntu-latest
outputs:
image-id: ${{ steps.meta.outputs.tags }}
permissions:
contents: read
packages: write
steps:
- name: Generate image ID
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: |
ghcr.io/${{ github.repository_owner }}/ozone-runner
tags: |
# keep single item
# any further tags should be added only in build-and-tag.yaml, not here
type=sha,prefix=,format=long
- name: Check if image exists
id: pull
run: |
success=false
if docker pull "$DOCKER_METADATA_OUTPUT_TAGS"; then
success=true
fi
echo "success=$success" >> $GITHUB_OUTPUT
- name: Set up QEMU
if: ${{ steps.pull.outputs.success == 'false' }}
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
- name: Set up Docker Buildx
if: ${{ steps.pull.outputs.success == 'false' }}
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Login to GitHub Container Registry
id: login
if: ${{ github.event_name != 'pull_request' && steps.pull.outputs.success == 'false' }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image to GitHub Container Registry
id: build
if: ${{ steps.pull.outputs.success == 'false' }}
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}