Skip to content

Commit

Permalink
Added GitHub Actions workflow to package and publish helm charts
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreenwood committed Apr 3, 2024
1 parent 1858071 commit 07f4324
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/package_and_push_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Package and Push Helm Chart

on:
push:
branches:
- dev
- release
- devops/FAIRSPC-57_github_actions
workflow_dispatch:
inputs:
version:
description: "Version of the Helm chart to push"
required: false

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare version
run: |
VERSION=$(cat ./VERSION)
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "Building images from the branch: $BRANCH"
if [ $BRANCH != "release" ]; then
VERSION=$VERSION-SNAPSHOT
fi
# override version of custom input is provided
if [[ -n "${{ github.event.inputs.version }}" ]]; then
VERSION=${{ github.event.inputs.version }}
fi
echo "Helm charts version to be deployed: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Setup Helm
uses: azure/[email protected]
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 jupyterhub https://jupyterhub.github.io/helm-chart
helm dependency update "charts/jupyter"
- name: Lint Helm chart
run: |
helm lint "charts/jupyter"
- name: Package Helm chart
run: |
helm package "charts/jupyter" --version ${{ env.VERSION }}
- name: Push Helm chart to repository
run: |
helm push "fairspace-jupyter-${{ env.VERSION }}.tgz" "oci://${{ vars.HELM_REGISTRY }}"
2 changes: 1 addition & 1 deletion charts/jupyter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
appVersion: "1.0"
description: Helm chart to install Jupyter along with a Fairspace workspace
name: jupyter
name: fairspace-jupyter
version: 0.0.0-RELEASEVERSION

dependencies:
Expand Down

0 comments on commit 07f4324

Please sign in to comment.