-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thuan Vo <thvo@redhat.com>
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release Helm Chart | ||
|
||
on: | ||
release: | ||
types: | ||
- "published" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
REPOSITORY: ${{ github.repository_owner }}/cryostatio.github.io | ||
REF: main | ||
CHART_VERSION: ${{ github.release.tag_name }} | ||
CHART_DOWNLOAD_URL: ${{ github.release.assets[0].browser_download_url }} | ||
|
||
jobs: | ||
helm-release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository_owner == 'cryostatio' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.REPOSITORY }} | ||
ref: ${{ env.REF }} | ||
token: "${{ secrets.CHART_REPO_TOKEN }}" | ||
- name: Generate chart index | ||
run: | | ||
DEST="${PWD}/helm-charts" | ||
TMP_DIR="$(mktemp -d)" | ||
pushd ${TMP_DIR} | ||
curl -LO $CHART_DOWNLOAD_URL && helm repo index . --url ${CHART_DOWNLOAD_URL%/*} --merge ${DEST}/index.yaml || exit 1 | ||
mv -f index.yaml ${DEST}/index.yaml | ||
popd | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
- name: Commit and push chart index | ||
run: | | ||
git add --all | ||
git commit -m "build(helm-charts): release chart version $CHART_VERSION" | ||
git push |
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