Skip to content

Fix upstream build and push CI job #48

Fix upstream build and push CI job

Fix upstream build and push CI job #48

name: Build and push images
on:
push:
branches:
- main
- release-*
workflow_dispatch:
env:
REGISTRY: quay.io
# Set tag 'latest' on main branch
REGISTRY_TAG: ${{ (github.head_ref||github.ref_name)=='main' && 'latest' || (github.head_ref||github.ref_name) }}
REGISTRY_ORG: mnecas0
VERSION: ${{ (github.head_ref||github.ref_name)=='main' && '99.0.0' || (github.head_ref||github.ref_name) }}
jobs:
build_push:
strategy:
fail-fast: false
matrix:
include:
- name: forklift-api
file: build/forklift-api/Containerfile
repo: forklift-api
- name: forklift-controller
file: build/forklift-controller/Containerfile
repo: forklift-controller
- name: forklift-operator
file: build/forklift-operator/Containerfile
repo: forklift-operator
- name: openstack-populator
file: build/openstack-populator/Containerfile
repo: openstack-populator
- name: openstack-populator
file: build/openstack-populator/Containerfile
repo: openstack-populator
- name: forklift-ova-provider-server
file: build/ova-provider-server/Containerfile
repo: forklift-ova-provider-server
- name: ovirt-populator
file: build/ovirt-populator/Containerfile-upstream
repo: ovirt-populator
- name: populator-controller
file: build/populator-controller/Containerfile
repo: populator-controller
- name: forklift-validation
file: build/validation/Containerfile
repo: forklift-validation
- name: virt-v2v
file: build/virt-v2v/Containerfile-upstream
repo: forklift-virt-v2v
runs-on: ubuntu-latest
steps:
- name: Checkout forklift
uses: actions/checkout@v4
- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push ${{ matrix.name }} image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "${{ matrix.file }}"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/${{ matrix.repo }}:${{ env.REGISTRY_TAG }}
build_push_bundle:
runs-on: ubuntu-latest
needs: build_push
steps:
- name: Checkout forklift
uses: actions/checkout@v4
- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push forklift-operator-bundle image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "build/forklift-operator-bundle/Containerfile"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-bundle:${{ env.REGISTRY_TAG }}
build-args: |
VERSION=${{ env.VERSION }}
build_push_index:
runs-on: ubuntu-latest
needs: build_push_bundle
steps:
- name: Checkout forklift
uses: actions/checkout@v4
- name: Login to ${{ env.REGISTRY }} with bot account
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push forklift-operator-index image to ${{ env.REGISTRY }}
uses: docker/build-push-action@v6
with:
push: true
file: "build/forklift-operator-index/Containerfile"
tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-index:${{ env.REGISTRY_TAG }}
build-args: |
OPERATOR_BUNDLE_IMAGE=${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/forklift-operator-bundle:${{ env.REGISTRY_TAG }}
STREAM=dev