This commit is contained in:
@@ -9,36 +9,15 @@ on:
|
|||||||
Example: `charts/my-app`.
|
Example: `charts/my-app`.
|
||||||
type: string
|
type: string
|
||||||
default: '.'
|
default: '.'
|
||||||
helm-version:
|
|
||||||
description: |
|
|
||||||
Helm version to install.
|
|
||||||
Example: `v3.14.0`. Defaults to `latest`.
|
|
||||||
type: string
|
|
||||||
default: 'latest'
|
|
||||||
runs-on:
|
|
||||||
description: 'Runner label to use for the job.'
|
|
||||||
type: string
|
|
||||||
default: 'ubuntu-latest'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint Helm chart
|
name: Lint Helm chart
|
||||||
runs-on: ${{ inputs.runs-on }}
|
runs-on: ubuntu-custom
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Setup Helm
|
|
||||||
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
|
|
||||||
with:
|
|
||||||
version: ${{ inputs.helm-version }}
|
|
||||||
|
|
||||||
- name: Update Helm dependencies
|
|
||||||
run: |
|
|
||||||
if grep -q '^dependencies:' "${{ inputs.chart-directory }}/Chart.yaml" 2>/dev/null; then
|
|
||||||
helm dependency update "${{ inputs.chart-directory }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Helm lint
|
- name: Helm lint
|
||||||
run: helm lint "${{ inputs.chart-directory }}"
|
run: helm lint "${{ inputs.chart-directory }}"
|
||||||
|
|
||||||
|
|||||||
@@ -29,22 +29,13 @@ on:
|
|||||||
Example: `harbor.example.com`.
|
Example: `harbor.example.com`.
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
default: 'gitea.ldpt.fr'
|
||||||
repository:
|
repository:
|
||||||
description: |
|
description: |
|
||||||
Repository path within the OCI registry.
|
Repository path within the OCI registry.
|
||||||
Example: `myorg/charts`.
|
Example: `myorg/charts`.
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
helm-version:
|
|
||||||
description: |
|
|
||||||
Helm version to install.
|
|
||||||
Example: `v3.14.0`. Defaults to `latest`.
|
|
||||||
type: string
|
|
||||||
default: 'latest'
|
|
||||||
runs-on:
|
|
||||||
description: 'Runner label to use for the job.'
|
|
||||||
type: string
|
|
||||||
default: 'ubuntu-latest'
|
|
||||||
secrets:
|
secrets:
|
||||||
OCI_REGISTRY_USERNAME:
|
OCI_REGISTRY_USERNAME:
|
||||||
description: 'Username for the OCI registry.'
|
description: 'Username for the OCI registry.'
|
||||||
@@ -56,16 +47,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
name: Publish Helm chart
|
name: Publish Helm chart
|
||||||
runs-on: ${{ inputs.runs-on }}
|
runs-on: ubuntu-custom
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Setup Helm
|
|
||||||
uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
|
|
||||||
with:
|
|
||||||
version: ${{ inputs.helm-version }}
|
|
||||||
|
|
||||||
- name: Override chart version
|
- name: Override chart version
|
||||||
if: ${{ inputs.chart-version != '' }}
|
if: ${{ inputs.chart-version != '' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -80,12 +66,6 @@ jobs:
|
|||||||
"${{ inputs.chart-directory }}/Chart.yaml"
|
"${{ inputs.chart-directory }}/Chart.yaml"
|
||||||
echo "App version set to: ${{ inputs.app-version }}"
|
echo "App version set to: ${{ inputs.app-version }}"
|
||||||
|
|
||||||
- name: Update Helm dependencies
|
|
||||||
run: |
|
|
||||||
if grep -q '^dependencies:' "${{ inputs.chart-directory }}/Chart.yaml" 2>/dev/null; then
|
|
||||||
helm dependency update "${{ inputs.chart-directory }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Login to OCI registry
|
- name: Login to OCI registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.OCI_REGISTRY_PASSWORD }}" | \
|
echo "${{ secrets.OCI_REGISTRY_PASSWORD }}" | \
|
||||||
@@ -104,7 +84,3 @@ jobs:
|
|||||||
echo "Pushing $pkg to oci://${{ inputs.oci-registry }}/${{ inputs.repository }}"
|
echo "Pushing $pkg to oci://${{ inputs.oci-registry }}/${{ inputs.repository }}"
|
||||||
helm push "$pkg" "oci://${{ inputs.oci-registry }}/${{ inputs.repository }}"
|
helm push "$pkg" "oci://${{ inputs.oci-registry }}/${{ inputs.repository }}"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Logout from OCI registry
|
|
||||||
if: always()
|
|
||||||
run: helm registry logout "${{ inputs.oci-registry }}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user