Skip to content

Prepare for 0.6.0 release #24

Prepare for 0.6.0 release

Prepare for 0.6.0 release #24

name: Build image from a tag and push it to Quay.io
on:
push:
tags:
- '*' # Trigger for all tags
env:
IMAGE_NAME: lightspeed-stack
IMAGE_NAMESPACE: lightspeed-core
IMAGE_REGISTRY: quay.io
GIT_TAG: ${{ github.ref_name }}
LATEST_TAG: latest
CONTAINER_FILE: deploy/lightspeed-stack/Containerfile
jobs:
build-and-push-release:
runs-on: ubuntu-latest
permissions:
contents: read
# Required for image pushing to a registry
packages: write
steps:
- name: Install buildah
run: |
sudo apt update
# qemu is required for arm64 builds
sudo apt install -y buildah qemu-user-static
- name: Checkout code
uses: actions/checkout@v4
with:
# Fetch submodules (required for lightspeed-providers)
submodules: 'recursive'
# Fetch all tags to determine latest stable version
fetch-tags: true
- name: Determine if latest tag should be applied
id: check_latest
run: ./scripts/latest-tag.py
- name: Build image with Buildah
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: >-
${{ env.GIT_TAG }}
${{ steps.check_latest.outputs.apply_latest == 'true' && env.LATEST_TAG || '' }}
containerfiles: |
${{ env.CONTAINER_FILE }}
archs: amd64, arm64
oci: true
- name: Check images
run: |
buildah images | grep '${{ env.IMAGE_NAME }}'
echo '${{ steps.build_image.outputs.image }}'
echo '${{ steps.build_image.outputs.tags }}'
- name: Check manifest
run: |
set -x
buildah manifest inspect ${{ steps.build_image.outputs.image-with-tag }}
- name: Push image to Quay.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}
username: ${{ secrets.QUAY_REGISTRY_USERNAME }}
password: ${{ secrets.QUAY_REGISTRY_PASSWORD }}