From a723f1af52acffdb1a2284811c07caa1704eb008 Mon Sep 17 00:00:00 2001 From: Links2004 Date: Thu, 4 Jan 2024 11:43:13 +0100 Subject: [PATCH] add test workflow --- .github/workflows/test.yaml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..6e8ac3305 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,38 @@ +name: test + +on: + push: + tags: + - t5.* + +jobs: + kustomize: + runs-on: ubuntu-latest + steps: + - name: install flux + uses: fluxcd/flux2/action@v2.2.2 + - name: Clone repo + uses: actions/checkout@v4 + + - name: Prepare + run: | + # OCI standard enforces lower-case paths + KUSTOMIZE_REPO=$(echo "oci://ghcr.io/${{ github.repository_owner }}/kustomize/grafana-operator" | tr '[:upper:]' '[:lower:]') + GHCR_REPO=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]') + echo "KUSTOMIZE_REPO=$KUSTOMIZE_REPO" >> $GITHUB_ENV + echo "GHCR_REPO=$GHCR_REPO" >> $GITHUB_ENV + - name: update-kustomize-image + run: | + # Install kustomize + make kustomize + # Update image to match the new image and tag + cd deploy/kustomize/base + kustomize edit set image ghcr.io/${{ github.repository }}=${{ env.GHCR_REPO }}:${{ github.ref_name }} + - name: update-kustomize-assert + run: | + mkdir -p /tmp/kustomize-build + kustomize build deploy/kustomize/base > /tmp/kustomize-build/kustomize-base.yaml + for d in deploy/kustomize/overlays/*/ ; do + kustomize build "$d" > /tmp/kustomize-build/kustomize-$(basename "$d").yaml + done + gh release upload $GITHUB_REF /tmp/kustomize-build/kustomize-*.yaml \ No newline at end of file