Skip to content

Draft: feat: IBM Cloud support #2438

Draft: feat: IBM Cloud support

Draft: feat: IBM Cloud support #2438

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-builds
on:
push:
branches: [ main, "0.8" ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
build-and-upload:
name: Build and Upload Images
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
steps:
- name: Free Disk Space for Docker
uses: endersonmenezes/free-disk-space@v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
rm_cmd: "rmz"
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Podman (only for arm64)
if: contains(matrix.os, 'arm')
run: |
sudo apt-get update -y
sudo apt-get -y install podman
- name: Set environment variables based on architecture
run: |
if [[ "${{ matrix.os }}" == *"arm"* ]]; then
echo "ARCH_TYPE=arm64" >> $GITHUB_ENV
else
echo "ARCH_TYPE=amd64" >> $GITHUB_ENV
fi
- name: Build image for PR
if: github.event_name == 'pull_request'
env:
IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
shell: bash
run: |
make oci-build-${{ env.ARCH_TYPE }}
make oci-save-${{ env.ARCH_TYPE }}
- name: Build and Push image for Release
if: github.event_name == 'push'
run: |
make oci-build-${{ env.ARCH_TYPE }}
make oci-save-${{ env.ARCH_TYPE }}
- name: Upload mapt artifacts for PR
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: mapt-${{ env.ARCH_TYPE }}
path: mapt*
combine-artifacts:
name: combine-artifacts
needs: build-and-upload
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- name: Download mapt oci flatten images
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
pattern: mapt-*
- name: copy both artifacts into single directory
env:
IMG: ghcr.io/redhat-developer/mapt:pr-${{ github.event.number }}
run: echo ${IMG} > mapt-image
- name: Upload combined mapt artifacts for PR
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: mapt-arm64-and-amd64
path: mapt-*
push:
name: push
if: github.event_name == 'push'
needs: build-and-upload
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Download mapt oci flatten images
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
pattern: mapt-*
- name: Log in quay.io
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Push image for Release
if: github.event_name == 'push'
run: |
make oci-load
make oci-push