Skip to content

GH actions build

GH actions build #1

name: Multiarch build
on:
push: true
jobs:
multiarch-build:
name: Build images
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Calculate tags
id: calc-tag
env:
ref: ${{ github.ref_name }}
run: |
echo "Building images from ${GITHUB_REF}@${GITHUB_SHA}"
# Ref: https://regex101.com/r/gcxd4h/1
major_minor="$(echo "$ref" | sed -E 's/^.*?v?([[:digit:]]+)\.([[:digit:]]+).*/\1.\2/')"
echo "container_version=v${major_minor}" >> $GITHUB_OUTPUT
echo "Container version: v${major_minor}"
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: php
tags: ${{ steps.calc-tag.outputs.container_version }}
platforms: linux/amd64, linux/arm64
containerfiles: Containerfile
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
if: github.event.name == 'push' && github.base.ref == 'master'
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/wavesoftware
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}