Skip to content

Publish Helm charts

Publish Helm charts #4

name: Publish Helm charts
on:
release:
types: [published]
jobs:
build-and-push:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version
id: semver
uses: LykkeBusiness/[email protected]
with:
tag: ${{ github.ref }}
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Package tftbscbridge chart
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm package -d packagedcharts --app-version ${{ steps.semver.outputs.non-prefixed }} --version ${{ steps.semver.outputs.non-prefixed }} bsc/helmchart/tftbscbridge
- name: Upload tftbscbridge packaged chart
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: packagedcharts/tftbscbridge-${{ steps.semver.outputs.non-prefixed }}.tgz
asset_name: tftbscbridge-${{ steps.semver.outputs.non-prefixed }}.tgz
asset_content_type: application/gzip
- name: Download helm repo index
run: cd packagedcharts && curl -O https://raw.githubusercontent.com/threefoldfoundation/helmcharts/main/index.yaml
- name: Merge helm charts into the index
run: helm repo index packagedcharts --merge packagedcharts/index.yaml --url https://github.com/threefoldfoundation/tft/releases/download/${{ github.ref }}
- name: publish the updated helm repo index
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ github.token }}
with:
source_file: 'packagedcharts/index.yaml'
destination_repo: 'threefoldfoundation/helmcharts'
#user_email: '[email protected]'
user_name: ${{ github.actor }}
commit_message: 'threefoldfoundation/tft ${{github.ref_name}}'