-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: NVSHAS-9624 rewrite gh-page publish flow
Per EIO team's requirement, rewrite how we publish helm repo Also upgraded actions/checkout to v4
- Loading branch information
1 parent
3ddd337
commit 36d9cb0
Showing
2 changed files
with
28 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,37 @@ name: Publish Charts on tagging | |
|
||
on: | ||
push: | ||
tags: '*' | ||
tags: 'v*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
env: | ||
TAG: ${{ github.ref_name }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Publish Helm charts | ||
uses: becitsthere/helm-gh-pages@master | ||
- uses: actions/checkout@v4 | ||
- name: Setup helm | ||
uses: azure/[email protected] | ||
with: | ||
charts_dir: charts | ||
helm_version: 3.2.0 | ||
token: ${{ secrets.HELM_PUBLISHER_TOKEN }} | ||
version: v3.16.2 | ||
- name: Publish Helm charts | ||
run: | | ||
CHARTS_TMP_DIR=$(mktemp -d) | ||
helm lint charts/core charts/crd charts/monitor | ||
helm package charts/core charts/crd charts/monitor --destination ${CHARTS_TMP_DIR} --version ${TAG#v} | ||
git clone https://x-access-token:${{ secrets.HELM_PUBLISHER_TOKEN }}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} repo | ||
cd repo/ | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
git remote set-url origin "https://x-access-token:${{ secrets.HELM_PUBLISHER_TOKEN }}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}" | ||
git checkout gh-pages | ||
if [[ -f "index.yaml" ]]; then | ||
FLAGS="--merge index.yaml" | ||
fi | ||
helm repo index ${CHARTS_TMP_DIR} --url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} ${FLAGS} | ||
mv -f ${CHARTS_TMP_DIR}/*.tgz ./ | ||
mv -f ${CHARTS_TMP_DIR}/index.yaml ./index.yaml | ||
git add . | ||
git commit -m "Publish ${{ github.ref_name }}" | ||
git push origin gh-pages |
This file was deleted.
Oops, something went wrong.