Release 0.28.0-adobe-20250921 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-publish-operator-docker-and-chart | |
| on: | |
| push: | |
| tags-ignore: | |
| - 'kafka-*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # GitHub Container Registry | |
| GHCR_REGISTRY: ghcr.io | |
| # github.repository as <account>/<repo> | |
| GHCR_IMAGE_NAME: ${{ github.repository }} | |
| # Docker Hub image name | |
| DOCKERHUB_IMAGE: adobe/kafka-operator | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Get tag name | |
| id: vars | |
| run: echo "tag=${GITHUB_REF:10}" >> $GITHUB_OUTPUT | |
| # Login against Docker Hub | |
| - name: Login to DockerHub Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| # Login against GitHub Container Registry | |
| - name: Log into GitHub Container Registry ${{ env.GHCR_REGISTRY }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.GHCR_REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set Release Date | |
| run: | | |
| echo "BUILT_AT=$(date --rfc-3339=date)" >> ${GITHUB_ENV} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Extract metadata (tags, labels) for Docker | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ env.DOCKERHUB_IMAGE }} | |
| ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=tag | |
| - name: Build and push operator docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| build-args: | | |
| VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
| BUILT_AT=${{ env.BUILT_AT }} | |
| GIT_SHA=${{ github.sha }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| # Update Helm Chart version | |
| - name: Update Chart.yaml version | |
| run: | | |
| sed -i "s/^version:.*/version: \"${{ steps.vars.outputs.tag }}\"/" charts/kafka-operator/Chart.yaml | |
| sed -i "s/^appVersion:.*/appVersion: \"${{ steps.vars.outputs.tag }}\"/" charts/kafka-operator/Chart.yaml | |
| # Push Helm Chart to GitHub Container Registry | |
| - name: Push Helm Chart to GHCR | |
| uses: appany/[email protected] | |
| with: | |
| name: kafka-operator | |
| repository: ${{ github.repository_owner }}/koperator | |
| tag: ${{ steps.vars.outputs.tag }} | |
| path: charts/kafka-operator | |
| registry: ${{ env.GHCR_REGISTRY }} | |
| registry_username: ${{ github.actor }} | |
| registry_password: ${{ secrets.GITHUB_TOKEN }} | |
| update_dependencies: 'true' |