Prerelease Helm Chart #21
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
name: Prerelease Helm Chart | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- Helm_artifacts | |
env: | |
HELM_CHART_VERSION: 1.1.0 | |
MATLAB_APP_VERSION: "R2024b" | |
jobs: | |
release-helm-chart: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
- name: Check that chart exists | |
run: | | |
CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" && cat ${CHART_DIR}/Chart.yaml | |
echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if exists | |
- name: Check chart versions | |
run: | | |
grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml | |
- name: Package the chart | |
run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} | |
- name: Login to GitHub Container Registry | |
run: echo ${{ secrets.CR_TOKEN }} | helm registry login ${{ secrets.MATHWORKS_REGISTRY }} --username ${{ secrets.CR_USER }} --password-stdin | |
- name: Deploy the chart | |
run: helm push matlab-prodserver-k8s-${{ env.HELM_CHART_VERSION }}.tgz oci://${{ secrets.MATHWORKS_REGISTRY }} | |