Skip to content

feat: add a debug endpoint to validate inputs #25

feat: add a debug endpoint to validate inputs

feat: add a debug endpoint to validate inputs #25

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- master
tags:
- '*'
env:
DOCKERHUB_REPO: kainlite/gitops-operator
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup docker buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config: .github/buildkitd.toml
- name: Configure tags based on git tags + latest
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ github.repository }}
tags: |
type=sha,prefix=,suffix=,format=short
type=sha,prefix=,suffix=,format=long
type=ref,event=branch
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
- name: Rust Build Cache for Docker
uses: actions/cache@v4
with:
path: rust-build-cache
key: ${{ runner.os }}-${{ env.PLATFORM_PAIR }}-build-cache-${{ hashFiles('**/Cargo.toml') }}
- name: inject rust-build-cache into docker
uses: overmindtech/buildkit-cache-dance/inject@main
with:
cache-source: rust-build-cache
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
outputs: type=image,"name=${{ env.DOCKERHUB_REPO }}",push-by-digest=true,name-canonical=true,push=true
build-args: |
BUILDPLATFORM=${{ matrix.platform }}
TARGETPLATFORM=${{ matrix.platform }}
- 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
- name: extract rust-build-cache from docker
uses: overmindtech/buildkit-cache-dance/extract@main
with:
cache-source: rust-build-cache
merge:
runs-on: ubuntu-24.04
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Configure tags based on git tags + latest
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.DOCKERHUB_REPO }}
tags: |
type=sha,prefix=,suffix=,format=short
type=sha,prefix=,suffix=,format=long
type=ref,event=branch
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=pr
- 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.DOCKERHUB_REPO }}@sha256:%s ' *)