Skip to content

Commit

Permalink
feat: add helm packaging and publish
Browse files Browse the repository at this point in the history
Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed Apr 5, 2024
1 parent a6037bd commit 438a675
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions .github/workflows/publish.yaml
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

0 comments on commit 438a675

Please sign in to comment.