Fix helm chart publishing (#613) #242
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: Image | |
| # Build and push the konnector + backend images and Helm charts on tags: | |
| # - tags v* -> ghcr.io/<owner>/konnector:<version>, ghcr.io/<owner>/backend:<version> | |
| # - tags v* -> oci://ghcr.io/<owner>/charts/{konnector-v2,backend-v2}:<version> | |
| # No :latest or :<sha> tags — the image repo is shared with v1/main images. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Multi-arch via in-Dockerfile cross-compile (builder pinned to | |
| # BUILDPLATFORM), so no QEMU is required. | |
| - name: Build and push | |
| run: | | |
| owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" | |
| for target in konnector backend; do | |
| docker buildx build \ | |
| --platform linux/amd64,linux/arm64 \ | |
| --target "${target}" \ | |
| --tag "ghcr.io/${owner}/${target}:${GITHUB_REF_NAME}" \ | |
| --label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \ | |
| --label "org.opencontainers.image.revision=${{ github.sha }}" \ | |
| --label "org.opencontainers.image.title=${target}" \ | |
| --cache-from type=gha \ | |
| --cache-to type=gha,mode=max \ | |
| --provenance=false \ | |
| --push \ | |
| . | |
| done | |
| publish-chart: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Helm | |
| uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 | |
| - name: Log in to GHCR for Helm | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin | |
| - name: Version from tag | |
| id: v | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Package and push Helm charts (OCI) | |
| run: | | |
| owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" | |
| make helm-push VERSION=${{ steps.v.outputs.version }} HELM_REPO="ghcr.io/${owner}/charts" |