Skip to content

Make container build only run for metal3.io repo #356

Make container build only run for metal3.io repo

Make container build only run for metal3.io repo #356

name: build-images-action
permissions:
contents: read
on:
push:
branches:
- 'main'
- 'release-*'
tags:
- 'v*'
jobs:
build_bmo:
name: Build BMO container image
runs-on: ubuntu-latest
# if: github.repository == metal3-io/baremetal-operator
steps:
- name: Check if not a fork
id: check
run: |
if [[ "${{ github.repository }}" != "metal3-io/baremetal-operator" ]]; then
echo "::set-output name=run::false"
else
echo "::set-output name=run::true"
fi
- name: Run build
if: steps.check.outputs.run == 'true'
uses: metal3-io/project-infra/.github/workflows/container-image-build.yml@main
with:
image-name: "baremetal-operator"
pushImage: true
secrets:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
build_keepalived:
name: Build keepalived container image
if: github.repository == metal3-io/baremetal-operator
uses: metal3-io/project-infra/.github/workflows/container-image-build.yml@main
with:
image-name: "keepalived"
dockerfile-directory: resources/keepalived-docker
pushImage: true
secrets:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}