upload helm chart to cloudsmith

This commit is contained in:
Maidul Islam
2022-12-05 12:04:23 -05:00
parent e67620c3ce
commit 9ee5f3d41b
2 changed files with 19 additions and 16 deletions

View File

@ -1,33 +1,26 @@
name: Release Charts
name: Release Helm Charts
on: [workflow_dispatch]
jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0
- name: Run chart-releaser
- name: Build helm package
run: cd helm-charts && helm package ./infisical
uses: helm/chart-releaser-action@v1.4.1
with:
charts_dir: helm-charts
- name: Install python and Cloudsmith CLI
uses: actions/setup-python@v4
run: pip install --upgrade cloudsmith-cli
- name: Push helm package to Cloudsmith
run: cd helm-charts && sh upload-to-cloudsmith.sh
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}

View File

@ -0,0 +1,10 @@
## Loop through each helm chart directoy and build each into helm package
for d in */ ; do
helm package $d
done
## Upload each packaged helm chart
for i in *.tgz; do
[ -f "$i" ] || break
cloudsmith push helm --republish infisical/helm-charts $i
done