mirror of
https://github.com/stakater/Reloader.git
synced 2026-02-14 18:09:50 +00:00
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
name: Pull Request Workflow for Helm Chart changes
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'deployments/kubernetes/chart/reloader/**'
|
|
|
|
env:
|
|
DOCKER_FILE_PATH: Dockerfile
|
|
DOCKER_UBI_FILE_PATH: Dockerfile.ubi
|
|
KUBERNETES_VERSION: "1.30.0"
|
|
KIND_VERSION: "0.23.0"
|
|
REGISTRY: ghcr.io
|
|
|
|
jobs:
|
|
|
|
helm-chart-validation:
|
|
permissions:
|
|
contents: read
|
|
|
|
runs-on: ubuntu-latest
|
|
name: Helm Chart Validation
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{github.event.pull_request.head.sha}}
|
|
fetch-depth: 0
|
|
|
|
# Setting up helm binary
|
|
- name: Set up Helm
|
|
uses: azure/setup-helm@v4
|
|
with:
|
|
version: v3.11.3
|
|
|
|
- name: Helm chart unit tests
|
|
uses: d3adb5/helm-unittest-action@v2
|
|
with:
|
|
charts: deployments/kubernetes/chart/reloader
|
|
|
|
helm-version-validation:
|
|
needs: helm-chart-validation
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
runs-on: ubuntu-latest
|
|
name: Helm Version Validation
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'release/helm-chart') }}
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: ${{github.event.pull_request.head.sha}}
|
|
fetch-depth: 0
|
|
|
|
- name: Add Stakater Helm Repo
|
|
run: |
|
|
helm repo add stakater https://stakater.github.io/stakater-charts
|
|
|
|
- name: Get version for chart from helm repo
|
|
id: chart_eval
|
|
run: |
|
|
current_chart_version=$(helm search repo stakater/reloader | tail -n 1 | awk '{print $2}')
|
|
echo "CURRENT_CHART_VERSION=$(echo ${current_chart_version})" >> $GITHUB_OUTPUT
|
|
|
|
- name: Get Updated Chart version from Chart.yaml
|
|
uses: mikefarah/yq@master
|
|
id: new_chart_version
|
|
with:
|
|
cmd: yq e '.version' deployments/kubernetes/chart/reloader/Chart.yaml
|
|
|
|
- name: Check Version
|
|
uses: aleoyakas/check-semver-increased-action@v1
|
|
id: check-version
|
|
with:
|
|
current-version: ${{ steps.new_chart_version.outputs.result }}
|
|
previous-version: ${{ steps.chart_eval.outputs.CURRENT_CHART_VERSION }}
|
|
|
|
- name: Fail if Helm Chart version isnt updated
|
|
if: steps.check-version.outputs.is-version-increased != 'true'
|
|
run: |
|
|
echo "Helm Chart Version wasnt updated"
|
|
exit 1
|