sig-cloud-instance-images/.github/workflows/build-2nd-layer.yml

69 lines
1.9 KiB
YAML

---
name: Build images 2nd layer images
on:
push:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: "0 1 * * 0"
jobs:
run_image_builds:
strategy:
matrix:
version:
- major: 8
arch: 'amd64, arm64'
- major: 9
arch: 'amd64, arm64, s390x'
type:
- micro
- init
registry:
- domain: docker.io
account: rockylinux
secret: DOCKER
- domain: quay.io
account: rockylinux
secret: QUAY
runs-on: ubuntu-latest
name: Build and push images
steps:
- uses: actions/checkout@v3
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Setup Registry login
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets[format('{0}_USERNAME', matrix.registry.secret)] }}
password: ${{ secrets[format('{0}_TOKEN', matrix.registry.secret)] }}
registry: ${{ matrix.registry.domain }}
- name: Build image
uses: redhat-actions/buildah-build@v2
id: build-image
with:
archs: ${{ matrix.version.arch }}
build-args: |
ImageVersion=${{ matrix.version.major }}
containerfiles: |
./Containerfile-${{ matrix.type }}
labels: |
name=rockylinux
version=${{ matrix.version.major }}-ubi-${{ matrix.type }}
oci: true
tags: ${{ matrix.registry.domain }}/${{ matrix.registry.account }}/rockylinux:${{ matrix.version.major }}-ubi-${{ matrix.type }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
extra-args: |
--format=v2s2