Skip to content

[DRAFT / DO NOT MERGE] Aap 58797 chatbot auth tests #1143

[DRAFT / DO NOT MERGE] Aap 58797 chatbot auth tests

[DRAFT / DO NOT MERGE] Aap 58797 chatbot auth tests #1143

name: "[PR] Build and publish Operator, Bundle and Catalog artifacts"
on:
pull_request:
branches:
- main
jobs:
get_operator_versions:
uses: ./.github/workflows/common-get-operator-versions.yaml
secrets: inherit
get_service_version:
uses: ./.github/workflows/common-get-service-version.yaml
secrets: inherit
get_chatbot_version:
uses: ./.github/workflows/common-get-chatbot-version.yaml
secrets: inherit
get_mcpserver_version:
uses: ./.github/workflows/common-get-mcpserver-version.yaml
secrets: inherit
build:
runs-on: ubuntu-24.04
needs: [get_operator_versions, get_service_version, get_chatbot_version, get_mcpserver_version]
env:
REGISTRY: "quay.io/ansible"
steps:
# ===============================
# Checkout code
# -------------------------------
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
# ===============================
# ===============================
# Login to repositories
# -------------------------------
- name: Log into registry ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into target registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
# ===============================
# ===============================
# Construct next version
# -------------------------------
# Build complete PR version
- name: Semver tags
id: version_semver
run: |
echo "IMAGE_SEMVER_VERSION=${{ needs.get_operator_versions.outputs.operator_version_next }}-pr-${{ github.event.pull_request.number }}-$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV
# ===============================
# ===============================
# Create docker tags
# -------------------------------
- name: Tag Name
id: tag_name
run: |
echo "IMAGE_TAGS=-t ${{ env.REGISTRY }}/ansible-ai-connect-operator:${IMAGE_SEMVER_VERSION}" >> $GITHUB_OUTPUT
echo "LABEL quay.expires-after=3d" >> ./Dockerfile # tag expires in 3 days
# ===============================
# ===============================
# Operator
# -------------------------------
- name: Build and store Operator image in @ghcr
run: |
BUILD_ARGS="--build-arg DEFAULT_AI_CONNECT_VERSION=${{ needs.get_service_version.outputs.service_version }} \
--build-arg DEFAULT_CHATBOT_AI_CONNECT_VERSION=${{ needs.get_chatbot_version.outputs.chatbot_version }} \
--build-arg DEFAULT_MCP_SERVER_VERSION=${{ needs.get_mcpserver_version.outputs.mcpserver_version }} \
--build-arg OPERATOR_VERSION=${IMAGE_SEMVER_VERSION}" \
IMG=ghcr.io/${{ github.repository_owner }}/ansible-ai-connect-operator:${{ github.sha }} \
make docker-buildx
- name: Publish Operator images to registries
run: |
docker buildx imagetools create ghcr.io/${{ github.repository_owner }}/ansible-ai-connect-operator:${{ github.sha }} ${{ steps.tag_name.outputs.IMAGE_TAGS }}
# ===============================
# ===============================
# Operator bundle
# -------------------------------
- name: Build and tag Bundle images
run: |
make bundle bundle-build VERSION=${IMAGE_SEMVER_VERSION} IMG=${{ env.REGISTRY }}/ansible-ai-connect-operator:${IMAGE_SEMVER_VERSION} BUNDLE_IMG=ansible-ai-connect-bundle:${IMAGE_SEMVER_VERSION}
- name: Push Bundle images to registry
uses: redhat-actions/[email protected]
with:
image: ansible-ai-connect-bundle
tags: ${{ env.IMAGE_SEMVER_VERSION }}
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
# ===============================
# ===============================
# Operator catalog
# -------------------------------
- name: Build and tag Catalog images
run: |
make catalog-build CATALOG_IMG=ansible-ai-connect-catalog:${IMAGE_SEMVER_VERSION} BUNDLE_IMG=${{ env.REGISTRY }}/ansible-ai-connect-bundle:${IMAGE_SEMVER_VERSION}
- name: Push Catalog images to registry
uses: redhat-actions/[email protected]
with:
image: ansible-ai-connect-catalog
tags: ${{ env.IMAGE_SEMVER_VERSION }}
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
# ===============================