-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add helm packaging and publish
Signed-off-by: Youngjin Jo <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 additions
and
8 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 |
---|---|---|
@@ -1,15 +1,51 @@ | ||
name: Publish Helm charts | ||
name: Publish Helm Chart | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
paths: | ||
- 'charts/**' | ||
tags: | ||
- 'chart-*' | ||
|
||
jobs: | ||
publish-chart: | ||
release-chart: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Publish Helm charts | ||
uses: stefanprodan/helm-gh-pages@master | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure Helm | ||
run: helm version | ||
|
||
- name: Package Helm chart | ||
run: | | ||
mkdir ./release | ||
helm package charts/my-chart --destination ./release | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::$(cat charts/my-chart/Chart.yaml | grep version: | cut -d ' ' -f 2) | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: chart-${{ steps.get_version.outputs.VERSION }} | ||
release_name: Chart Release ${{ steps.get_version.outputs.VERSION }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Helm chart to GitHub Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./release/my-chart-${{ steps.get_version.outputs.VERSION }}.tgz | ||
asset_name: my-chart-${{ steps.get_version.outputs.VERSION }}.tgz | ||
asset_content_type: application/octet-stream | ||
|