remove resource limits on Compose file templates (#51) #58
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: Release Helm Chart | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" | |
# `chart-releaser-action` only performs a `git diff` on Chart files. If we have a workflow where we want to | |
# merge something without bumping the Chart version yet to create a release, the chart-releaser-action will | |
# fail, since git detects that changes have been made, but the Chart version wasn't bumped. We don't want an | |
# erroneous failure in this case, as that dev workflow is intentional. So this step detects if the Helm chart | |
# version was bumped, and only continues if it was. | |
# | |
# This relies on PRs being squashed when merged (as it compares the head commit to its parent). | |
# This is currently enforced in the repositories PR settings. | |
- name: Check if Chart version was bumped | |
id: check-chart-version | |
run: | | |
CHART_DIR="charts/deepgram-self-hosted" | |
if git diff --name-only HEAD^..HEAD | grep "^$CHART_DIR"; then | |
if [ ! -f "$CHART_DIR/Chart.yaml" ]; then | |
echo "Error: Chart.yaml not found in $CHART_DIR" | |
EXIT_CODE=1 | |
continue | |
fi | |
OLD_VERSION=$(git show HEAD^:$CHART_DIR/Chart.yaml | grep '^version:' | awk '{print $2}') | |
NEW_VERSION=$(grep '^version:' $CHART_DIR/Chart.yaml | awk '{print $2}') | |
if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then | |
echo "$CHART_DIR has been changed, but version has not been bumped, so not performing release." | |
echo "IS_CHART_VERSION_BUMPED=false" >> $GITHUB_OUTPUT | |
else | |
echo "$CHART_DIR has been updated, and version has been bumped from $OLD_VERSION to $NEW_VERSION." | |
echo "Proceeding with release..." | |
echo "IS_CHART_VERSION_BUMPED=true" >> $GITHUB_OUTPUT | |
fi | |
else | |
echo "deepgram-self-hosted chart was not modified." | |
echo "IS_CHART_VERSION_BUMPED=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Configure Git | |
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | |
run: | | |
# Give CI a git identity for its commit message | |
git config --global user.email "[email protected]" | |
git config --global user.name "Deepgram CI" | |
- name: Install Helm | |
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | |
uses: azure/setup-helm@v4 | |
env: | |
GITHUB_TOKEN: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" | |
- name: Add Helm chart repositories for chart dependencies | |
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | |
run: | | |
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo add autoscaler https://kubernetes.github.io/autoscaler | |
helm repo update | |
- name: Run chart-releaser | |
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" |