Skip to content

Merge pull request #149 from konflux-ci/konflux/mintmaker/main/regist… #45

Merge pull request #149 from konflux-ci/konflux/mintmaker/main/regist…

Merge pull request #149 from konflux-ci/konflux/mintmaker/main/regist… #45

name: Build syft image
on:
push:
branches:
- main
paths:
- syft/Dockerfile
pull_request:
branches:
- main
paths:
- syft/Dockerfile
env:
REGISTRY: quay.io/redhat-appstudio
IMAGE_NAME: syft
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version from Dockerfile
id: extract-version
run: echo "version=$(grep -oP '(?<=ARG syft_version=")[^"]*' syft/Dockerfile)" >> $GITHUB_OUTPUT
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: v${{ steps.extract-version.outputs.version }}
context: .
containerfiles: |
./syft/Dockerfile
- name: Push to Quay
if: github.event_name == 'push' # don't push image from PR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}