Skip to content

Commit

Permalink
Merge pull request #107 from travier/podman-build-all
Browse files Browse the repository at this point in the history
  • Loading branch information
travier committed Dec 16, 2023
2 parents 8a8d1a7 + 2e03844 commit 988cfe3
Show file tree
Hide file tree
Showing 26 changed files with 575 additions and 787 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/almalinux-pr.yaml

This file was deleted.

86 changes: 56 additions & 30 deletions .github/workflows/almalinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: "AlmaLinux: Build and push toolbx images"
permissions: read-all

on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -12,54 +15,77 @@ on:
schedule:
- cron: '0 0 * * MON'

# Prevent multiple workflow runs from racing
concurrency: ${{ github.workflow }}

env:
distro: 'almalinux'
distro_pretty: 'AlmaLinux'
latest_release: '9'
platforms: 'linux/amd64, linux/arm64'
registry: 'quay.io/toolbx-images'

# 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-and-push-images:
build-push-images:
strategy:
matrix:
release: ['8', '9']

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU for multi-arch builds
shell: bash
run: |
sudo apt install qemu-user-static
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: 'toolbx-images+github'
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push ${{ env.distro_pretty }} ${{ matrix.release }} toolbox image
uses: docker/build-push-action@v3
- name: Build container image
uses: redhat-actions/buildah-build@v2
if: env.latest_release != matrix.release
with:
platforms: ${{ env.platforms }}
context: ${{ env.distro }}/${{ matrix.release }}
file: ${{ env.distro }}/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: quay.io/toolbx-images/${{ env.distro }}-toolbox:${{ matrix.release }}
image: ${{ env.distro }}-toolbox
tags: ${{ matrix.release }}
containerfiles: ${{ env.distro }}/${{ matrix.release }}/Containerfile
layers: false
oci: true

- name: Push latest tag
- name: Build container image (latest tag)
uses: redhat-actions/buildah-build@v2
if: env.latest_release == matrix.release
uses: docker/build-push-action@v3
with:
platforms: ${{ env.platforms }}
context: ${{ env.distro }}/${{ matrix.release }}
file: ${{ env.distro }}/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: quay.io/toolbx-images/${{ env.distro }}-toolbox:latest
image: ${{ env.distro }}-toolbox
tags: ${{ matrix.release }} latest
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' && env.latest_release != matrix.release
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}
image: ${{ env.distro }}-toolbox
registry: ${{ env.registry }}
tags: ${{ matrix.release }}

- name: Push to Container Registry (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: ${{ matrix.release }} latest
43 changes: 0 additions & 43 deletions .github/workflows/alpine-pr.yaml

This file was deleted.

86 changes: 56 additions & 30 deletions .github/workflows/alpine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: "Alpine Linux: Build and push toolbx images"
permissions: read-all

on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -12,54 +15,77 @@ on:
schedule:
- cron: '0 0 * * MON'

# Prevent multiple workflow runs from racing
concurrency: ${{ github.workflow }}

env:
distro: 'alpine'
distro_pretty: 'Alpine Linux'
latest_release: '3.19'
platforms: 'linux/amd64, linux/arm64'
registry: 'quay.io/toolbx-images'

# 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-and-push-images:
build-push-images:
strategy:
matrix:
release: ['3.16', '3.17', '3.18', '3.19', 'edge']

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU for multi-arch builds
shell: bash
run: |
sudo apt install qemu-user-static
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: 'toolbx-images+github'
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push ${{ env.distro_pretty }} ${{ matrix.release }} toolbox image
uses: docker/build-push-action@v3
- name: Build container image
uses: redhat-actions/buildah-build@v2
if: env.latest_release != matrix.release
with:
platforms: ${{ env.platforms }}
context: ${{ env.distro }}/${{ matrix.release }}
file: ${{ env.distro }}/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: quay.io/toolbx-images/${{ env.distro }}-toolbox:${{ matrix.release }}
image: ${{ env.distro }}-toolbox
tags: ${{ matrix.release }}
containerfiles: ${{ env.distro }}/${{ matrix.release }}/Containerfile
layers: false
oci: true

- name: Push latest tag
- name: Build container image (latest tag)
uses: redhat-actions/buildah-build@v2
if: env.latest_release == matrix.release
uses: docker/build-push-action@v3
with:
platforms: ${{ env.platforms }}
context: ${{ env.distro }}/${{ matrix.release }}
file: ${{ env.distro }}/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: quay.io/toolbx-images/${{ env.distro }}-toolbox:latest
image: ${{ env.distro }}-toolbox
tags: ${{ matrix.release }} latest
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' && env.latest_release != matrix.release
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_SECRET }}
image: ${{ env.distro }}-toolbox
registry: ${{ env.registry }}
tags: ${{ matrix.release }}

- name: Push to Container Registry (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: ${{ matrix.release }} latest
43 changes: 0 additions & 43 deletions .github/workflows/amazonlinux-pr.yaml

This file was deleted.

Loading

0 comments on commit 988cfe3

Please sign in to comment.