diff --git a/.github/workflows/chart-release.yaml b/.github/workflows/chart-release.yaml index ad162c9..94dc893 100644 --- a/.github/workflows/chart-release.yaml +++ b/.github/workflows/chart-release.yaml @@ -2,30 +2,57 @@ name: Release Charts on: push: - tags: - - 'v*.*.*' + branch: + - FS-1428 jobs: build: name: Publish Helm Chart runs-on: ubuntu-latest + env: + CHART_DIR: chart + CHART_REPO: metal-toolbox/fleet-scheduler + CHART_NAME: fleet-scheduler + CHART_REPO_BRANCH: main + CHART_VERSION: 0.0.3 steps: - name: Checkout uses: actions/checkout@v4 with: + path: ${{ env.CHART_NAME }} fetch-depth: 0 - - name: Configure Git + name: Checkout Helm chart Repo + uses: actions/checkout@v4 + with: + repository: jakeschuurmans/helm-chart-test + path: helm-chart + token: ${{ secrets.GITHUB_TOKEN }} + - + name: Install Helm + uses: azure/setup-helm@v4.2.0 + - + name: Install yq + uses: mikefarah/yq@v4.40.3 + - + name: Package Helm Chart + run: | + sed -i "s/VERSION/${{ env.CHART_VERSION }}/g" ./${{ env.CHART_NAME }}/chart/Chart.yaml + helm package ./${{ env.CHART_NAME }}/chart -u -d ./helm-chart/ + helm repo index ./helm-chart/ --url https://jakeschuurmans.github.io/helm-chart-test + - + name: Create Git Commit run: | + cd helm-chart git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add index.yaml *.tgz + git commit -m "published ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}.tgz" - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 + name: Push Changes + uses: ad-m/github-push-action@master with: - charts_dir: . - config: - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}" \ No newline at end of file + directory: helm-chart + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aada51a..14bf63e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: Release Fleet-Scheduler on: push: diff --git a/chart/Chart.yaml b/chart/Chart.yaml index cb2e546..b98c506 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: fleet-scheduler description: A chart for fleet scheduled cron jobs -version: 1.0.1 +version: VERSION # To be updated by github action when tag is created keywords: - cron home: "https://github.com/metal-toolbox/fleet-scheduler"