Compare commits

...

2 Commits

Author SHA1 Message Date
5506152772 Add image digest as output 2025-08-23 00:51:40 +02:00
24e4ad7a98 Make uploading manifests optional 2025-08-23 00:44:26 +02:00

View File

@@ -5,12 +5,17 @@ on:
inputs: inputs:
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
default: false type: boolean
required: false upload_manifests:
description: Upload manifest files to OCI repository
type: boolean type: boolean
webhook_url: webhook_url:
description: Webhook to call after build is completed description: Webhook to call after build is completed
type: string type: string
outputs:
digest:
description: Digest of the build docker container
value: ${{ jobs.build.outputs.digest }}
env: env:
OCI_REPO: git.huizinga.dev/dreaded_x/${{ gitea.event.repository.name}} OCI_REPO: git.huizinga.dev/dreaded_x/${{ gitea.event.repository.name}}
@@ -19,6 +24,8 @@ jobs:
build: build:
name: Build container and manifests name: Build container and manifests
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
digest: ${{ steps.build.outputs.digest }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -84,10 +91,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
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
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" \