-
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.
Added github actions workflow to package and push helm chart
- Loading branch information
1 parent
75ca420
commit 04b81a8
Showing
1 changed file
with
56 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,56 @@ | ||
name: Package and Push Helm Chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- release | ||
- devops/FAIRSPC-55_github_actions | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: "Manual trigger for Helm chart packaging and pushing" | ||
release_type: | ||
description: "Release or snapshot version?" | ||
required: true | ||
default: "SNAPSHOT" | ||
options: | ||
- "SNAPSHOT" | ||
- "RELEASE" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Helm | ||
uses: azure/setup-helm@v4.1.0 | ||
with: | ||
version: ${{ vars.HELM_VERSION }} | ||
|
||
- name: Login with Helm | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.HELM_REGISTRY }} --username ${{ github.repository_owner }} --password-stdin | ||
- name: Add/update Helm dependencies | ||
run: | | ||
helm repo add codecentric https://codecentric.github.io/helm-charts | ||
helm dependency update "charts/fairspace-keycloak" | ||
- name: Prepare version | ||
run: | | ||
VERSION=$(cat ./VERSION) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Package and Push Helm chart to repository | ||
run: | | ||
helm package "charts/fairspace-keycloak" --version ${{ env.VERSION }} | ||
helm push "fairspace-keycloak-${{ env.VERSION }}.tgz" "oci://${{ vars.HELM_REGISTRY }}" | ||
echo "Pushed package to repository" | ||
- name: Clean up | ||
run: | | ||
rm -rf "fairspace-keycloak*.tgz" |