Build toolbox images #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build toolbox images | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
schedule: | |
- cron: "30 0 * * 0" | |
jobs: | |
run_toolbox_builds: | |
strategy: | |
matrix: | |
version: | |
- major: 8 | |
arch: 'amd64, arm64' | |
- major: 9 | |
arch: 'amd64, arm64, ppc64le, s390x' | |
registry: | |
- domain: docker.io | |
account: rockylinux | |
secret: DOCKER | |
- domain: quay.io | |
account: rockylinux | |
secret: QUAY | |
runs-on: ubuntu-latest | |
name: Build and push toolbox 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: | | |
./Dockerfile | |
extra-args: | | |
--squash | |
labels: | | |
name=rocky-toolbox | |
org.opencontainers.image.title=rocky-toolbox | |
org.opencontainers.image.version=${{ matrix.version.major }} | |
oci: true | |
tags: ${{ matrix.registry.domain }}/${{ matrix.registry.account }}/rocky-toolbox:${{ matrix.version.major }} | |
- 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 |