Skip to content

Commit

Permalink
add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Links2004 committed Jan 4, 2024
1 parent d3508c0 commit 6978b10
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test.yaml
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

0 comments on commit 6978b10

Please sign in to comment.