Skip to content

Commit

Permalink
Update chart paths
Browse files Browse the repository at this point in the history
  • Loading branch information
sd109 committed Sep 11, 2024
1 parent f944876 commit 6e94a97
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/helm-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
workflow_dispatch:

env:
CHART_YAML_PATH: deployment/helm/charts/danswer/Chart.yaml
VALUES_YAML_PATH: deployment/helm/charts/danswer/values.yaml

jobs:
helm_chart_version_check:
runs-on: ubuntu-latest
Expand All @@ -20,11 +24,11 @@ jobs:
# on main or a stable tag on a dev branch.

- name: Fail on semver pre-release chart version
run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]'
run: yq .version ${{ env.CHART_YAML_PATH }} | grep -v '[a-zA-Z-]'
if: ${{ github.ref_name == 'main' }}

- name: Fail on stable semver chart version
run: yq .version deployment/helm/Chart.yaml | grep '[a-zA-Z-]'
run: yq .version ${{ env.CHART_YAML_PATH }} | grep '[a-zA-Z-]'
if: ${{ github.ref_name != 'main' }}

# To reduce resource usage images are built only on tag.
Expand All @@ -37,19 +41,19 @@ jobs:
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list
| jq .tags
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
| grep $( yq .appVersion ${{ env.CHART_YAML_PATH }} )-$( yq .tagSuffix ${{ env.VALUES_YAML_PATH }} )
&&
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list
| jq .tags
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
| grep $( yq .appVersion ${{ env.CHART_YAML_PATH }} )-$( yq .tagSuffix ${{ env.VALUES_YAML_PATH }} )
# Check if current chart version exists in releases already
- name: Check for Helm chart version bump
id: version_check
run: |
set -xe
chart_version=$(yq .version deployment/helm/Chart.yaml)
chart_version=$(yq .version ${{ env.CHART_YAML_PATH }})
if [[ $(curl https://api.github.com/repos/stackhpc/danswer/releases | jq '.[].tag_name' | grep danswer-helm-$chart_version) ]]; then
echo chart_version_changed=false >> $GITHUB_OUTPUT
else
Expand Down

0 comments on commit 6e94a97

Please sign in to comment.