Skip to content

Merge pull request #173 from matysek/lcore-311 #3

Merge pull request #173 from matysek/lcore-311

Merge pull request #173 from matysek/lcore-311 #3

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
REGISTRY: quay.io
GIT_TAG: ${{ github.ref_name }}
LATEST_TAG: latest
CONTAINER_FILE: 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
sudo apt install -y buildah
- name: Checkout code
uses: actions/checkout@v4
- name: Build image with Buildah
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: |
${{ env.GIT_TAG }}
${{ env.LATEST_TAG }}
containerfiles: |
${{ env.CONTAINER_FILE }}
oci: true
- 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 }}