fix(deps): update kubernetes packages to v0.32.1 #112
This file contains 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 Image | |
on: | |
pull_request_target: | |
types: | |
- labeled | |
- synchronize | |
branches: | |
- main | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: bojanzelic/cloudflare-zero-trust-operator | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build: [ | |
{platform: linux/amd64, cache: amd64}, | |
{platform: linux/arm64, cache: arm64}, | |
] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ matrix.build.platform }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha,prefix=sha- | |
type=ref,event=tag | |
flavor: | | |
latest=false | |
suffix=-${{ matrix.build.cache }} | |
# For pull requests, build and push platform-specific images | |
- name: Build and push Docker image | |
if: github.event_name == 'push' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')) | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: ${{ matrix.build.platform }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: | | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.build.cache }} | |
cache-to: | | |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.build.cache }},mode=max | |
merge-manifests: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=tag | |
type=sha,prefix=sha- | |
- name: Create and push manifest lists | |
run: | | |
# Read all tags into an array | |
readarray -t TAGS <<< "${{ steps.meta.outputs.tags }}" | |
for TAG in "${TAGS[@]}"; do | |
MANIFEST_IMAGES="" | |
for CACHE in "amd64" "arm64"; do | |
MANIFEST_IMAGES="$MANIFEST_IMAGES ${TAG}-$CACHE" | |
done | |
# Trim leading space from MANIFEST_IMAGES | |
MANIFEST_IMAGES="${MANIFEST_IMAGES# }" | |
echo "Creating manifest list for ${TAG} with images: ${MANIFEST_IMAGES}" | |
docker buildx imagetools create -t ${TAG} ${MANIFEST_IMAGES} | |
done |