GitHub: Use podman/buildah and merge workflows (centos) #66
Workflow file for this run
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: "openSUSE: Build and push toolbx images" | |
permissions: read-all | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
paths: | |
- opensuse/** | |
- .github/workflows/opensuse.yaml | |
schedule: | |
- cron: '0 0 * * MON' | |
env: | |
distro: 'opensuse' | |
distro_pretty: 'openSUSE' | |
latest_release: 'tumbleweed' | |
# Prevent multiple workflow runs from racing to ensure that pushes are made | |
# sequentialy for the main branch. Also cancel in progress workflow runs for | |
# pull requests only. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build-push-images: | |
strategy: | |
matrix: | |
release: ['tumbleweed'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU for multi-arch builds | |
shell: bash | |
run: | | |
sudo apt install qemu-user-static | |
- name: Build container image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
platforms: linux/amd64, linux/arm64 | |
context: ${{ env.distro }}/${{ matrix.release }} | |
image: ${{ env.distro }}-toolbox | |
tags: ${{ matrix.release }} | |
containerfiles: ${{ env.distro }}/${{ matrix.release }}/Containerfile | |
layers: false | |
oci: true | |
- name: Push to Container Registry | |
uses: redhat-actions/push-to-registry@v2 | |
id: push | |
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | |
with: | |
username: ${{ secrets.QUAY_ROBOT_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
image: ${{ env.distro }}-toolbox | |
registry: ${{ env.REGISTRY }} | |
tags: ${{ matrix.release }} | |
- name: Login to Container Registry | |
uses: redhat-actions/podman-login@v1 | |
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_ROBOT_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Push latest tag | |
uses: redhat-actions/push-to-registry@v2 | |
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' && env.latest_release == matrix.release | |
with: | |
username: ${{ secrets.BOT_USERNAME }} | |
password: ${{ secrets.BOT_SECRET }} | |
image: ${{ env.distro }}-toolbox | |
registry: ${{ env.REGISTRY }} | |
tags: latest |