Compare commits

...

4 Commits

View File

@@ -6,8 +6,8 @@ on:
generate_crds: generate_crds:
description: Runs a binary called gencrd in the docker container and writes the output to ./manifests/crds.yaml description: Runs a binary called gencrd in the docker container and writes the output to ./manifests/crds.yaml
type: boolean type: boolean
upload_manifests: push_manifests:
description: Upload manifest files to OCI repository description: Push manifest files to OCI repository
default: true default: true
type: boolean type: boolean
webhook_url: webhook_url:
@@ -49,12 +49,12 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Install kustomize - name: Install kustomize
if: inputs.upload_manifests == true if: inputs.push_manifests == true
run: | run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
- name: Setup Flux CLI - name: Setup Flux CLI
if: inputs.upload_manifests == true if: inputs.push_manifests == true
uses: https://github.com/fluxcd/flux2/action@main uses: https://github.com/fluxcd/flux2/action@main
with: with:
version: v2.5.0 version: v2.5.0
@@ -63,7 +63,6 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: ${{ env.OCI_REPO }}
tags: | tags: |
type=edge type=edge
type=ref,event=branch type=ref,event=branch
@@ -71,21 +70,22 @@ jobs:
type=semver,pattern=v{{major}}.{{minor}} type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}} type=semver,pattern=v{{major}}
- name: Build container - name: Bake containers
id: build id: build
uses: docker/build-push-action@v6 uses: docker/bake-action@v6
with: with:
context: . files: |
./docker-bake.hcl
cwd://${{ steps.meta.outputs.bake-file }}
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
push: true push: true
sbom: true sbom: true
provenance: mode=max provenance: mode=max
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
"RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
env: env:
TAG_BASE: ${{ env.OCI_REPO }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Generate CRDs - name: Generate CRDs
@@ -94,12 +94,12 @@ jobs:
docker run --rm ${{ env.OCI_REPO }}@${{ steps.build.outputs.imageid }} /crdgen > ./manifests/crds.yaml docker run --rm ${{ env.OCI_REPO }}@${{ steps.build.outputs.imageid }} /crdgen > ./manifests/crds.yaml
- name: Kustomize manifests - name: Kustomize manifests
if: inputs.upload_manifests == true if: inputs.push_manifests == true
run: | run: |
./kustomize build ./manifests | sed "s/\${DIGEST}/${{ steps.build.outputs.digest }}/" > ./manifests.yaml ./kustomize build ./manifests | sed "s/\${DIGEST}/${{ steps.build.outputs.digest }}/" > ./manifests.yaml
- name: Push manifests - name: Push manifests
if: inputs.upload_manifests == true if: inputs.push_manifests == true
run: | run: |
flux push artifact oci://${{ env.OCI_REPO }}/manifests:${{ gitea.head_ref || gitea.ref_name }} \ flux push artifact oci://${{ env.OCI_REPO }}/manifests:${{ gitea.head_ref || gitea.ref_name }} \
--path="./manifests.yaml" \ --path="./manifests.yaml" \