Skip to content

Recreate OCT image #4815

Recreate OCT image

Recreate OCT image #4815

name: Recreate OCT image
on:
# Triggers the workflow every 6 hours
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
recreate-oct-container-image:
if: github.repository_owner == 'redhat-best-practices-for-k8s'
name: Create new OCT container image
runs-on: ubuntu-24.04
env:
SHELL: /bin/bash
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
ref: main
token: ${{ secrets.PULL_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Run endpoint verification script
run: |
./scripts/curl-endpoints.sh
- name: Authenticate against Quay.io (redhat-best-practices-for-k8s)
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: quay.io
# Use a Robot Account to authenticate against Quay.io
# https://docs.quay.io/glossary/robot-accounts.html
username: ${{ secrets.QUAY_ROBOT_USER_K8S }}
password: ${{ secrets.QUAY_ROBOT_TOKEN_K8S }}
- name: Build and push the latest images for multi-arch
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
build-args: |
TOKEN=${{ secrets.PULL_TOKEN }}
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
no-cache: true
push: true
tags: |
quay.io/redhat-best-practices-for-k8s/oct:latest
- name: If failed to create the image, send alert msg to dev team.
if: ${{ failure() }}
uses: ./.github/actions/slack-webhook-sender
with:
message: 'Failed to create official latest OCT image. Please check the logs.'
slack_webhook: '${{ secrets.SLACK_ALERT_WEBHOOK_URL }}'
recreate-oct-container-image-legacy:
name: Create new OCT container image (Legacy)
runs-on: ubuntu-24.04
env:
SHELL: /bin/bash
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
ref: main
token: ${{ secrets.PULL_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Run endpoint verification script
run: |
./scripts/curl-endpoints.sh
- name: Authenticate against Quay.io (testnetworkfunction)
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: quay.io
# Use a Robot Account to authenticate against Quay.io
# https://docs.quay.io/glossary/robot-accounts.html
username: ${{ secrets.QUAY_ROBOT_USER }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Build and push the latest images for multi-arch (Legacy)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
build-args: |
TOKEN=${{ secrets.PULL_TOKEN }}
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
no-cache: true
push: true
tags: |
quay.io/testnetworkfunction/oct:latest
- name: If failed to create the image, send alert msg to dev team.
if: ${{ failure() }}
uses: ./.github/actions/slack-webhook-sender
with:
message: 'Failed to create official latest OCT image. Please check the logs.'
slack_webhook: '${{ secrets.SLACK_ALERT_WEBHOOK_URL }}'