Skip to content

fix: add containerPort declaration for webhook in helm chart (#1961) #141

fix: add containerPort declaration for webhook in helm chart (#1961)

fix: add containerPort declaration for webhook in helm chart (#1961) #141

Workflow file for this run

name: Release Charts
on:
push:
branches:
- master
env:
REGISTRY_IMAGE: ghcr.io/kubeflow/spark-operator
jobs:
build-skip-check:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.skip-check.outputs.skip }}
version: ${{ steps.skip-check.outputs.VERSION_TAG }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Check if build should be skipped
id: skip-check
run: |
VERSION_TAG=$(cat charts/spark-operator-chart/Chart.yaml | grep "appVersion: .*" | cut -c13-)
if git rev-parse -q --verify "refs/tags/$VERSION_TAG"; then
echo "Spark-Operator Docker Image Tag $VERSION_TAG already exists!"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
git tag $VERSION_TAG
git push origin $VERSION_TAG
echo "Spark-Operator Docker Image new tag: $VERSION_TAG released"
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
release:
runs-on: ubuntu-latest
needs:
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
echo "SCOPE=${platform//\//-}" >> $GITHUB_ENV
- name: Set up QEMU
timeout-minutes: 1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3
- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Spark-Operator Docker Image to github container registry
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ env.SCOPE }}
cache-from: type=gha,scope=${{ env.SCOPE }}
push: true
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
publish:
runs-on: ubuntu-latest
needs:
- release
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
pattern: digests-*
path: /tmp/digests
merge-multiple: true
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: preview
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Release Spark-Operator Helm Chart
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "spark-operator-chart-{{ .Version }}"