Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update dependencies and update webhooks #244

Update dependencies and update webhooks

Update dependencies and update webhooks #244

Workflow file for this run

name: Publish a container image
on:
push:
release:
types: [published, edited]
jobs:
build:
runs-on: ubuntu-24.04
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set the image metadata
run: ./build/set_image_metadata
- name: Set the operator version from the tag
if: (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited'))
run: |-
echo OPERATOR_VERSION=${{ github.event.release.tag_name }} >> "$GITHUB_ENV"
- name: Set the operator version from the tag
if: github.event_name == 'push'
run: |-
echo OPERATOR_VERSION=${{ github.sha }} >> "$GITHUB_ENV"
- name: Build an image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: db-operator-dev
tags: ${{ env.TAGS }}
platforms: linux/amd64, linux/arm64/v8
build-args: |
OPERATOR_VERSION=${{ env.OPERATOR_VERSION }}
containerfiles: |
./Containerfile
labels: ${{ env.ANNOTATIONS }}
- name: Push the image to GHCR
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set the version tag (only if released)
id: retag-version
if: (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited'))
run: |
buildah tag \
${{ steps.build-image.outputs.image }}:v${{ github.sha }} \
ghcr.io/${{ github.repository_owner }}/db-operator:latest
buildah tag \
${{ steps.build-image.outputs.image }}:v${{ github.sha }} \
ghcr.io/${{ github.repository_owner }}/db-operator:${{ github.event.release.tag_name }}
- name: Push the release image to GHCR
if: (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited'))
uses: redhat-actions/push-to-registry@v2
with:
tags: ghcr.io/${{ github.repository_owner }}/db-operator:latest ghcr.io/${{ github.repository_owner }}/db-operator:${{ github.event.release.tag_name }}
username: ${{ github.actor }}
password: ${{ github.token }}