Skip to content

Merge pull request #559 from Xieql/pipeline-controller #8

Merge pull request #559 from Xieql/pipeline-controller

Merge pull request #559 from Xieql/pipeline-controller #8

Workflow file for this run

name: Release Charts
on:
push:
tags:
- "v*.*.*"
jobs:
release-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/kurator"
path: "kurator"
fetch-depth: 0
- name: Checkout helm-charts
uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/helm-charts"
# use token for helm-charts repo
token: "${{ secrets.HELM_CHARTER_TOKEN }}"
path: "helm-charts"
fetch-depth: 0
- name: Get chart version
run: |
echo "chart_version=$(echo ${GITHUB_REF##*/v})" >> $GITHUB_ENV
- name: Make charts
shell: bash
working-directory: kurator
run: |
VERSION=${{ env.chart_version }} make gen-chart
- name: Install chart-releaser
uses: helm/chart-releaser-action@v1.5.0
with:
install_only: true
# upload charts to helm-charts repos's release
- name: Upload charts
shell: bash
working-directory: kurator
run: |
cr upload -o ${{ github.repository_owner }} --config ./common/config/.cr.yaml
env:
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"
# copy artifacts to helm-charts repo, we need those for update index
- name: Copy artifacts
run: |
cp -r kurator/out/ helm-charts/
cp kurator/common/config/.cr.yaml helm-charts/.cr.yaml
- name: Configure Git
working-directory: helm-charts
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# this step will directly push to the main branch, so make sure you have the right permissions
- name: Update index
working-directory: helm-charts
run: |
rm -rf index.yaml
rm -rf .cr-index
mkdir -p .cr-index
cr index -o ${{ github.repository_owner }} --config .cr.yaml --push
env:
# use token for helm-charts repo
CR_TOKEN: "${{ secrets.HELM_CHARTER_TOKEN }}"