forked from grafana/grafana-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
- 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 |