-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (61 loc) · 1.89 KB
/
chart-release.yml
File metadata and controls
71 lines (61 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release Helm chart
on:
push:
tags:
- "chart-v*"
workflow_dispatch:
permissions:
contents: write
packages: write
concurrency:
group: chart-release-${{ github.ref }}
cancel-in-progress: false
env:
HELM_VERSION: v3.15.4
jobs:
release:
name: Publish chart to GH Pages + GHCR OCI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- name: Run chart-releaser (GH Pages)
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: deploy/helm
config: .github/cr.yaml
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push chart to GHCR (OCI)
env:
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
owner_lc="${OWNER,,}"
repo_lc="${REPO,,}"
# Reuse the .tgz chart-releaser already built; fall back if absent.
pkg_dir=".cr-release-packages"
[ -d "$pkg_dir" ] || {
pkg_dir=".chart-dist"
mkdir -p "$pkg_dir"
helm package deploy/helm/l9gpu --destination "$pkg_dir"
}
# Push under repo-scoped namespace to avoid collisions with other
# charts under ghcr.io/<owner>/charts owned by a different repo.
for pkg in "$pkg_dir"/*.tgz; do
helm push "$pkg" "oci://ghcr.io/${owner_lc}/${repo_lc}" || true
done