Skip to content

Commit bd0b571

Browse files
committed
Move chart and image checks to pre-checks job
1 parent 2e55abf commit bd0b571

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

.github/workflows/helm-build-push.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,29 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18+
# We mark any builds on main branch as latest GH release
19+
# so make sure we don't accidentally use a pre-release tag.
20+
- name: Fail on semver pre-release chart version
21+
run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]'
22+
if: ${{ github.ref_name == 'main' }}
23+
24+
# To reduce resource usage images are built only on tag.
25+
# To build a new set of images after committing and pushing
26+
# new changes to GitHub, use:
27+
# git tag <tag-name>
28+
# git push --tags
29+
- name: Fail if image tags don't exist
30+
run: >-
31+
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
32+
https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list
33+
| jq .tags
34+
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
35+
&&
36+
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
37+
https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list
38+
| jq .tags
39+
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
40+
1841
# Check if current chart version exists in releases already
1942
- name: Check for Helm chart version bump
2043
id: version_check
@@ -41,29 +64,6 @@ jobs:
4164
with:
4265
fetch-depth: 0
4366

44-
# We mark any builds on main branch as latest GH release
45-
# so make sure we don't accidentally use a pre-release tag.
46-
- name: Fail on semver pre-release chart version
47-
run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]'
48-
if: ${{ github.ref_name == 'main' }}
49-
50-
# To reduce resource usage images are built only on tag.
51-
# To build a new set of images after committing and pushing
52-
# new changes to GitHub, use:
53-
# git tag <tag-name>
54-
# git push --tags
55-
- name: Fail if image tags don't exist
56-
run: >-
57-
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
58-
https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list
59-
| jq .tags
60-
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
61-
&&
62-
curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)"
63-
https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list
64-
| jq .tags
65-
| grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml )
66-
6767
- name: Configure Git
6868
run: |
6969
git config user.name "$GITHUB_ACTOR"

0 commit comments

Comments
 (0)