Skip to content

Commit

Permalink
github/workflows/arch: Unified workflow, use buildah & podman
Browse files Browse the repository at this point in the history
- Use a unified workflow for both PR & Push jobs
- Build using buildah & push with podman

Signed-off-by: Timothée Ravier <[email protected]>
  • Loading branch information
travier committed Jan 22, 2024
1 parent 6dfd229 commit e771ff8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 52 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/arch-images-pr.yaml

This file was deleted.

63 changes: 42 additions & 21 deletions .github/workflows/arch-images.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Build and push the arch-toolbox image
name: "Arch Linux: Build and push arch-toolbox image"

permissions: read-all

on:
pull_request:
branches:
- main
paths:
- images/arch/**
- .github/workflows/arch-images.yaml
push:
branches:
- main
Expand All @@ -10,34 +18,47 @@ on:
schedule:
- cron: '0 0 * * MON'

# Prevent multiple workflow runs from racing
concurrency: ${{ github.workflow }}
env:
distro: 'arch'
platforms: 'linux/amd64'
registry: 'quay.io/toolbx'
username: 'toolbx+github'

# 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:
name: Build and push the arch-toolbox image

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: actions/checkout@v4

- name: Log in to Quay.io
uses: docker/login-action@v2
- name: Build container image (latest tag)
uses: redhat-actions/buildah-build@v2
if: env.latest_release == matrix.release
with:
registry: quay.io
username: 'toolbx+github'
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
platforms: ${{ env.platforms }}
context: images/${{ env.distro }}
image: ${{ env.distro }}-toolbox
tags: latest
containerfiles: images/${{ env.distro }}/Containerfile
layers: false
oci: true

- name: Build and push the arch-toolbox image
uses: docker/build-push-action@v3
- name: Push to Container Registry (latest tag)
uses: redhat-actions/push-to-registry@v2
id: push-latest
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
with:
context: images/arch
file: images/arch/Containerfile
platforms: linux/amd64
push: true
no-cache: true
tags: quay.io/toolbx/arch-toolbox:latest
username: ${{ env.username }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
image: ${{ env.distro }}-toolbox
registry: ${{ env.registry }}
tags: latest

0 comments on commit e771ff8

Please sign in to comment.