diff --git a/.github/workflows/chart-release.yaml b/.github/workflows/chart-release.yaml index ad162c9..7f4f66c 100644 --- a/.github/workflows/chart-release.yaml +++ b/.github/workflows/chart-release.yaml @@ -2,30 +2,55 @@ name: Release Charts on: push: - tags: + tag: - 'v*.*.*' jobs: build: name: Publish Helm Chart runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + env: + CHART_NAME: fleet-scheduler 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: metal-toolbox/fleet-scheduler + path: helm-charts + ref: gh-pages + fetch-depth: 0 + - + name: Install Helm + uses: azure/setup-helm@v4.2.0 + - + name: Package Helm Chart + run: | + sed -i "s/VERSION/${{ github.ref_name }}/g" ./${{ env.CHART_NAME }}/chart/Chart.yaml + helm package ./${{ env.CHART_NAME }}/chart -u -d ./helm-charts/ + helm repo index ./helm-charts/ --url https://metal-toolbox.github.io/helm-charts/ + - + name: Create Git Commit run: | + cd helm-charts 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 }}-${{ github.ref_name }}.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 + repository: metal-toolbox/fleet-scheduler + directory: helm-charts + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages \ No newline at end of file diff --git a/.github/workflows/push-pr-lint.yaml b/.github/workflows/push-pr-lint.yaml index 12c4b8f..72f2a0e 100644 --- a/.github/workflows/push-pr-lint.yaml +++ b/.github/workflows/push-pr-lint.yaml @@ -25,7 +25,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version-file: go.mod - name: Checkout code uses: actions/checkout@v4 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..32c5bc0 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,9 +1,9 @@ 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" +home: "https://github.com/metal-toolbox/helm-charts" sources: - - "https://github.com/metal-toolbox/fleet-scheduler" \ No newline at end of file + - "https://github.com/metal-toolbox/helm-charts" \ No newline at end of file