-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 1.52 KB
/
push-helm-chart.yaml
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
name: Push - Helm Chart
on:
push:
branches: [main]
jobs:
helm-chart-releaser:
name: Helm - Chart releaser
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git - Configure
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: OCI - Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Pushes updates to index.yaml found in the gh-pages branch when a new version is detected
- name: Helm - chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: charts
pages_branch: gh-pages
mark_as_latest: false
skip_existing: true
config: ./charts/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Helm - OCI Push to GHCR
run: |
if [ -z "$(ls -A .cr-release-packages)" ]; then
echo "No packages found under .cr-release-packages/"
exit 0
fi
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
REPO="${{ github.repository }}"
echo "Pushing $pkg to ghcr.io/${REPO,,}"
helm push "$pkg" "oci://ghcr.io/${REPO,,}"
done