Skip to content

oci-pr-push

oci-pr-push #284

Workflow file for this run

#
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed 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.
#
# SPDX-License-Identifier: Apache-2.0
name: oci-pr-push
on:
workflow_run:
workflows:
- oci-builds
types:
- completed
jobs:
push:
name: artifact-check-then-push
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Download mapt assets
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
name: mapt-arm64-and-amd64
continue-on-error: true
- name: Check if Artifact is Present
id: artifact-check
run: |
if [ -d "mapt-amd64" ] && [ -d "mapt-arm64" ]; then
echo "Artifacts found."
echo "found=true" >> $GITHUB_ENV
else
echo "Artifacts not found."
echo "found=false" >> $GITHUB_ENV
fi
- name: Get mapt build information
if: env.found == 'true'
run: |
echo "image=$(cat mapt-image)" >> "$GITHUB_ENV"
- name: Log in to ghcr.io
if: env.found == 'true'
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push mapt
if: env.found == 'true'
run: |
# Load images from build
podman load -i mapt-arm64/mapt-arm64.tar
podman load -i mapt-amd64/mapt-amd64.tar
# Push
podman push ${{ env.image }}-arm64
podman push ${{ env.image }}-amd64
podman manifest create ${{ env.image }}
podman manifest add ${{ env.image }} docker://${{ env.image }}-arm64
podman manifest add ${{ env.image }} docker://${{ env.image }}-amd64
podman manifest push --all ${{ env.image }}