Skip to content

Promote Operator Release #4

Promote Operator Release

Promote Operator Release #4

Workflow file for this run

name: Promote Operator Release
env:
ENGINE: docker # use docker for everything so buildx commands can be used
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'Name for the tag of the release.'
required: true
quay_registry:
description: 'Quay registry to push to.'
default: 'quay.io/ansible'
jobs:
promote-staged-release:
runs-on: ubuntu-latest
steps:
- name: Set TAG_NAME for workflow_dispatch event
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
echo "QUAY_REGISTRY=${{ github.event.inputs.quay_registry }}" >> $GITHUB_ENV
- name: Set TAG_NAME for release event
if: ${{ github.event_name == 'release' }}
run: |
echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "QUAY_REGISTRY=quay.io/ansible" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: 'main'
depth: 0
path: eda-server-operator
- name: Log into registry ghcr.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into registry quay.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Pull Stored Image and Publish eda-server-operator:${TAG_NAME}
run: |
docker buildx imagetools create \
ghcr.io/${{ github.repository }}:${TAG_NAME} \
--tag ${QUAY_REGISTRY}/eda-server-operator:${TAG_NAME} \
--tag ${QUAY_REGISTRY}/eda-server-operator:latest
working-directory: eda-server-operator
- name: Pull Stored Image and Publish eda-server-operator:latest
run: |
docker buildx imagetools create \
ghcr.io/${{ github.repository }}:${TAG_NAME} \
--tag ${QUAY_REGISTRY}/eda-server-operator:latest
working-directory: eda-server-operator
- name: Build Bundle Image
run: |
make bundle bundle-build IMG=quay.io/ansible/eda-server-operator:${TAG_NAME} VERSION=${TAG_NAME} BUNDLE_IMG=eda-server-operator-bundle:${TAG_NAME}
docker tag eda-server-operator-bundle:${TAG_NAME} eda-server-operator-bundle:latest
working-directory: eda-server-operator
- name: Push Bundle Image
uses: redhat-actions/[email protected]
with:
image: eda-server-operator-bundle
tags: ${{ env.TAG_NAME }} latest
registry: quay.io/ansible/
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build Catalog Image
run: |
make catalog-build CATALOG_IMG=eda-server-operator-catalog:${TAG_NAME} BUNDLE_IMG=quay.io/ansible/eda-server-operator-bundle:${TAG_NAME}
docker tag eda-server-operator-catalog:${TAG_NAME} eda-server-operator-catalog:latest
working-directory: eda-server-operator
- name: Push Catalog Image
uses: redhat-actions/[email protected]
with:
image: eda-server-operator-catalog
tags: ${{ env.TAG_NAME }} latest
registry: quay.io/ansible/
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}