diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..7da213465 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,48 @@ +name: test + +on: + push: + tags: + - t5.* + +permissions: + contents: write + +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: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create --draft --generate-notes "${{ github.ref_name }}" + + - 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + kustomize build deploy/kustomize/base > kustomize-base.yaml + for d in deploy/kustomize/overlays/*/ ; do + kustomize build "$d" > kustomize-$(basename "$d").yaml + done + gh release upload "${{ github.ref_name }}" kustomize-*.yaml \ No newline at end of file