n9e-helm
n9e-helm copied to clipboard
helm url support
能否使用 github action 自动构建基于 github page 的 helm chart 仓库 模板如下
name: Release Charts
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
- name: Add Helm repo
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_SKIP_EXISTING: true
感谢反馈,现在github action是用来做package release的。 你给的这个配置看起来是发布到https://charts.bitnami.com/bitnami ?
感谢反馈,现在github action是用来做package release的。 你给的这个配置看起来是发布到https://charts.bitnami.com/bitnami ?
不是的,是会在 gh 单独开一个 pages 分支做 http server 所以 ci 需要 content 写入
还是有些没太理解,最终是要做成什么样的效果?
感谢反馈,现在github action是用来做package release的。 你给的这个配置看起来是发布到https://charts.bitnami.com/bitnami ?
不是的,是会在 gh 单独开一个 pages 分支做 http server 所以 ci 需要 content 写入
@kongfei605 @incubator4 想实现的效果是
helm repo add n9e https://n9e.github.io/chart/
但是 github page 仓库是 n9e/n9e.github.io
, chart 仓库是 flashcatcloud/n9e-helm
供参考
name: Release Chart
on:
push:
tags:
- 'v*'
permissions: {}
jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
packages: write # needed for ghcr access
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- name: Run chart-releaser
uses: helm/[email protected]
with:
mark_as_latest: false
charts_dir: .
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
CR_GENERATE_RELEASE_NOTES: false
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" "oci://ghcr.io/n9e/charts"
done
感谢 @stringang 可以直接提个PR哈